How to retrieve lifecycle state of document before delete it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2018 09:41 AM
Hi,
I want to retrieve lifecycle state of document before delete it.
Anyone have a solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2018 09:55 AM
Hi Lassad,
using API v1 (https://doc.nuxeo.com/nxdoc/rest-api-endpoints/):
/nuxeo/api/v1/id/{docId}
/nuxeo/api/v1/path/{path}
you will get a document entity (more info about entities: https://doc.nuxeo.com/nxdoc/rest-api-entity-types/) And you can find the state attribute in the JSON response.
If you want to get lifecycle state from core using a DocumentModel instance (for example in your listener before delete) , you can use the public getCurrentLifeCycleState() method: https://github.com/nuxeo/nuxeo/blob/master/nuxeo-core/nuxeo-core-api/src/main/java/org/nuxeo/ecm/cor...
Regards, VS!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2018 11:32 AM
Hi Victor,
