<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: NXQL query for locked documents in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313896#M897</link>
    <description>&lt;P&gt;I tried your query and the first option worked correctly for me:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:lockOwner IS NOT NULL
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That query returned the 1 document I had locked of the specified doctype in the NQXL.&lt;/P&gt;
&lt;P&gt;If I use the option for &lt;CODE&gt;isCheckedIn&lt;/CODE&gt; then it returns all the documents of the specified doctype, not sure why but it doesn't seem to acknowledge that a locked file is checkedOut.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:isCheckedIn = 0
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tested this in my local environment which is LTS 2021 (hotfix 10). If your first query is not working, then maybe it has to do with the database you are using?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2021 16:31:43 GMT</pubDate>
    <dc:creator>Phil_Ludlow</dc:creator>
    <dc:date>2021-11-03T16:31:43Z</dc:date>
    <item>
      <title>NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313894#M895</link>
      <description>&lt;P&gt;Looking for a way to query for locked documents of a particular type.&lt;/P&gt;
&lt;P&gt;I've tried variations on this:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:lockOwner IS NOT NULL&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;including&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND (ecm:lockOwner IS NOT NULL or ecm:lockOwner &amp;lt;&amp;gt; ' ')&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;To test the query syntax I am working in a pre-production environment where I know that some but not all of the documents of the desired types are locked.  Regardless of how I word the query, I either get back all of the documents or none of the documents, not the desired subset.&lt;/P&gt;
&lt;P&gt;Any suggestions or help is appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 18:01:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313894#M895</guid>
      <dc:creator>Terry_A</dc:creator>
      <dc:date>2021-10-28T18:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313895#M896</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Try with &lt;CODE&gt;ecm:isCheckedIn = 0&lt;/CODE&gt; to find locked documents &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;More on &lt;A href="https://doc.nuxeo.com/nxdoc/nxql/#special-nxql-properties" target="test_blank"&gt;https://doc.nuxeo.com/nxdoc/nxql/#special-nxql-properties&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Tue, 02 Nov 2021 17:26:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313895#M896</guid>
      <dc:creator>Gregory_Carlin</dc:creator>
      <dc:date>2021-11-02T17:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313896#M897</link>
      <description>&lt;P&gt;I tried your query and the first option worked correctly for me:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:lockOwner IS NOT NULL
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That query returned the 1 document I had locked of the specified doctype in the NQXL.&lt;/P&gt;
&lt;P&gt;If I use the option for &lt;CODE&gt;isCheckedIn&lt;/CODE&gt; then it returns all the documents of the specified doctype, not sure why but it doesn't seem to acknowledge that a locked file is checkedOut.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM Document WHERE ecm:primaryType = 'DocumentType' AND ecm:isCheckedIn = 0
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tested this in my local environment which is LTS 2021 (hotfix 10). If your first query is not working, then maybe it has to do with the database you are using?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 16:31:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313896#M897</guid>
      <dc:creator>Phil_Ludlow</dc:creator>
      <dc:date>2021-11-03T16:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313897#M898</link>
      <description>&lt;P&gt;TBH I'm not sure if it was a database issue or something else, but whatever the case, some of these attributes such as ecm&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 16:35:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313897#M898</guid>
      <dc:creator>Terry_A</dc:creator>
      <dc:date>2021-11-03T16:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313898#M899</link>
      <description>&lt;P&gt;Hi !
I've got exactly the same problem.
What solution did you use ?&lt;/P&gt;
&lt;P&gt;The second question will be : how to unlock ALL locked documents (yes ... I have to do this because another software has locked many of them ...)&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 14:34:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313898#M899</guid>
      <dc:creator>opage_</dc:creator>
      <dc:date>2022-11-02T14:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313899#M900</link>
      <description>&lt;P&gt;It doesn't work:
It gives me locked and unlocked documents.
For example, It returns me this one which is locked&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;root@gedgfct1# curl &lt;A href="http://localhost:8080/nuxeo/api/v1/id/1d9d53df-ba30-443b-9216-6a83854a2c2b" target="test_blank"&gt;http://localhost:8080/nuxeo/api/v1/id/1d9d53df-ba30-443b-9216-6a83854a2c2b&lt;/A&gt; -u xxxx:xxxxxx -H 'fetch-document: lock'

{"entity-type":"document","repository":"default","uid":"1d9d53df-ba30-443b-9216-6a83854a2c2b","path":"/default-domain/workspaces/Cocktail/flux/numero:FLX-2022-001516/Bon de commande/Deployments.csv","type":"BonDeCommande","state":"project","parentRef":"0f365e91-ff21-435c-be32-d2ae39b0620d","isCheckedOut":true,"isRecord":false,"retainUntil":null,"hasLegalHold":false,"isUnderRetentionOrLegalHold":false,"isVersion":false,"isProxy":false,"changeToken":"3-0","isTrashed":false,"title":"Deployments.csv","lockOwner":"criecm","lockCreated":"2022-09-19T10:51:09.246Z","lastModified":"2022-09-19T10:51:09.220Z","facets":["Versionable","NXTag","Publishable","Commentable","HasRelatedText","Thumbnail"],"schemas":[{"name":"file_schema","prefix":"file_schema"},{"name":"uid","prefix":"uid"},{"name":"thumbnail","prefix":"thumb"},{"name":"file","prefix":"file"},{"name":"common","prefix":"common"},{"name":"bondecommande","prefix":"bondecommande"},{"name":"files","prefix":"files"},{"name":"dublincore","prefix":"dc"},{"name":"relatedtext","prefix":"relatedtext"},{"name":"facetedTag","prefix":"nxtag"}]}**#**
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but also this one which is unlocked&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;root@gedgfct1# curl &lt;A href="http://localhost:8080/nuxeo/api/v1/id/899fac1c-4d23-4971-8885-1dc298ac41e3" target="test_blank"&gt;http://localhost:8080/nuxeo/api/v1/id/899fac1c-4d23-4971-8885-1dc298ac41e3&lt;/A&gt; -u xxxxx:xxxxx -H 'fetch-document: lock'


  

{"entity-type":"document","repository":"default","uid":"899fac1c-4d23-4971-8885-1dc298ac41e3","path":"/default-domain/workspaces/Cocktail/flux/numero:FLX-2022-000647/Bon de commande/DEP_COMMANDE_LIGNE.png","type":"BonDeCommande","state":"project","parentRef":"74a4feb4-ccf2-4fcb-8533-9dfd95f76d8a","isCheckedOut":true,"isRecord":false,"retainUntil":null,"hasLegalHold":false,"isUnderRetentionOrLegalHold":false,"isVersion":false,"isProxy":false,"changeToken":"3-0","isTrashed":false,"title":"DEP_COMMANDE_LIGNE.png","lastModified":"2022-06-03T08:00:10.747Z","facets":["Versionable","NXTag","Publishable","Commentable","HasRelatedText","Thumbnail"],"schemas":[{"name":"file_schema","prefix":"file_schema"},{"name":"uid","prefix":"uid"},{"name":"thumbnail","prefix":"thumb"},{"name":"file","prefix":"file"},{"name":"common","prefix":"common"},{"name":"bondecommande","prefix":"bondecommande"},{"name":"files","prefix":"files"},{"name":"dublincore","prefix":"dc"},{"name":"relatedtext","prefix":"relatedtext"},{"name":"facetedTag","prefix":"nxtag"}]}**#**
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As Terry said "some of these attributes such as ecm:lockOwner and ecm:isCheckedIn were not updating to the database properly for locked documents"&lt;/P&gt;
&lt;P&gt;I've opened a case with Nuxeo support&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2022 12:41:29 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313899#M900</guid>
      <dc:creator>opage_</dc:creator>
      <dc:date>2022-11-03T12:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: NXQL query for locked documents</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313900#M901</link>
      <description>&lt;P&gt;I've found part of the problem:
As the "redis" template was in use, the locks are managed by RedisLockManager, hence stored in redis.&lt;/P&gt;
&lt;P&gt;The solution is to delete all the keys whose prefix is "nuxeo:lock:"&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 08:00:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/nxql-query-for-locked-documents/m-p/313900#M901</guid>
      <dc:creator>opage_</dc:creator>
      <dc:date>2022-11-04T08:00:26Z</dc:date>
    </item>
  </channel>
</rss>

