How to know if a document is a version with Java Client 3.5.0
Hello,
I am trying to know if a document is a version, but Java Client doesn't retrieve that information about a document. When I use the “fetchDocumentById” method, I get a “Document” object, but I have no properties to know if it is a version or not. I have included the “properties” header with the “*” value in order to retrieve all propoerties, but “ecm” properties are not retrieved.
I have used the REST API and I can see two properties that can tell me if the document is a version or not: versionableId and isVersion. However, none of them are present in the “Document” object retrieved by the fetchDocumentById method.
Then, how can I know if a document is a version? I have also seen a facet called “Immutable” present in versions, but I am not sure if it is possible there are other documents with that facet without being a version.
Thank you.
Hello,
I've just created JAVACLIENT-197 ticket to add missing fields to Document
class.
In the meantime, you should be able to extend the Document
class in order to add missing fields + register this new class during client construction. You can find more information in the documentation, in your case you should have something like below:
NuxeoClient client = new NuxeoClient.Builder()
.url("http://localhost:8080/nuxeo")
.authentication("Administrator", "Administrator")
.registerEntity(EntityTypes.DOCUMENT, YourDocument.class);
.connect();
We've released today the 3.6.0 version which contains JAVACLIENT-197.
Regards.
Hello,
The property which differentiate a live document from a version is ecm:isVersion
.
Regards