Hi all,
I use this code :
//Retrieve liveVersion from version
DocumentModel liveVersion = session.getDocument(new
IdRef(docVersion.getSourceId()));
//get versionModels from liveVersion
List<VersionModel> versionModels =
session.getVersionsForDocument(liveVersion.getRef());
//find in all VersionModel the one corresponding docVersion
VersionModel versionModel = null;
for (VersionModel tmp : versionModels) {
//get version document
DocumentModel versionDoc =
session.getDocumentWithVersion(liveVersion.getRef(), tmp);
if (versionDoc.equals(docVersion)) {
versionModel = tmp;
}
}
Le 11/12/2009 15:21, Raymond Bourges a écrit :
Hi all,
I work with nuxeo 5.3 and SQL storage.
In my code I have a DocumentModel object corresponding to a version of
an "original" DocumentModel object. I want to find the VersionModel
object "corresponding" to my DocumentModel object but I don't know how
to do.
I see relation in the database but I don't find how to do in java.
Could you help me ?
Thanks.
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm