How to check for recently deleted documents?
I have a set up which syncs content from Nuxeo to Drupal. To add content from Nuxeo to Drupal is simple, I query for recently modified Nuxeo documents. However deleting content in Drupal if it is deleted in Nuxeo is a little trickier.
Currently I'm comparing against the document ids in my map table to Drupal. I query Nuxeo for documents in an list of IDs (those from the map table) and if one exists in Drupal but not the Nuxeo results it is deleted. But with over 15000 documents in Nuxeo and the query only being able to handle approx 80 ids at a time (because it is effectively a GET request with the ids in the query string), it takes a long time.
Is it possible to query deleted documents while they are in the trash?
Hi,
I think you would have better results using an Event handler on Document removed
triggering an Automation script with a Blob.PostToURL
operation POSTing to a URL on Drupal actually removing the document.
Some references:
SELECT * FROM Document WHERE ecm:currentLifeCycleState = 'deleted' AND dc:modified > TIMESTAMP '$timestamp'
. Note for anyone else looking for this functionality: I had previously tried this type of query but as I was using wrappers from the Drupal CMIS module, it wasn't valid. So instead I think it is better to use the Nuxeo client with operation Document.Query
and the above query.