05-18-2020 10:58 AM
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.
05-29-2020 10:01 AM
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();
05-18-2020 03:40 PM
Hello,
The property which differentiate a live document from a version is ecm:isVersion
.
Regards
05-19-2020 02:21 AM
Hello. I knew about that property, and it is retrieved with the REST API. However, that property it is not retrieved with Java Client when doing a "fetchDocumentById" (and I am including the "properties" header with an "*" to see all properties). The "Document" object retrieved doesn't have such property, nor any of "ecm". So, how can I know if the document is a version in this situation? Is it a Java Client bug?
05-19-2020 09:32 AM
Hi, I'm not an expert of the .NET client but you should retrieve any document property no?
05-19-2020 09:43 AM
Hello. I am using Java Client, not .NET Client. However, I think they work similar. All SDKs work over the nuxeo REST API. If you retrieve a document and all its properties using the REST API, properties from "ecm" schema are not retrieved (as "ecm" is not a "real" schema). With the REST API you can get the "isVersion" property, but not in the "properties" array (https
05-29-2020 10:01 AM
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();
06-29-2020 11:15 AM
Hello,
07-01-2020 06:03 AM
Amazing! I will update my Nuxeo Java Client version to 3.6.0. Thank you!
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.