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?

0 votes

1 answers




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:

0 votes

Thanks. I'm trying to avoid writing any modules for Nuxeo though, as I have little experience in java. Is there not a query I could run?

The event handler and associated automation chain can be written in an XML contribution without any Java code. But you may obtain a satisfying result with NXQL querying ecm:currentLifeCycleState = 'deleted' and dc:modified > XXX

Thanks - I was able to achieve what I wanted using the query 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.