objInfo.setBaseType(typeDef.getBaseTypeId());
objInfo.setObject(od);
// versioning information:
if (so instanceof DocumentVersion) {
DocumentVersion ver = (DocumentVersion) so;
DocumentVersion pwc = ver.getParentDocument().getPwc();
objInfo.setIsCurrentVersion(ver == ver.getParentDocument().getLatestVersion(false));
objInfo.setVersionSeriesId(ver.getParentDocument().getId());
objInfo.setWorkingCopyId(pwc == null ? null : pwc.getId());
objInfo.setWorkingCopyOriginalId(pwc == ver ? ver.getParentDocument().getLatestVersion(false).getId()
: null);
} else if (so instanceof VersionedDocument) {
VersionedDocument doc = (VersionedDocument) so;
DocumentVersion pwc = doc.getPwc();
objInfo.setIsCurrentVersion(false);
objInfo.setVersionSeriesId(doc.getId());
objInfo.setWorkingCopyId(pwc == null ? null : pwc.getId());
objInfo.setWorkingCopyOriginalId(null);
} else { // unversioned document
objInfo.setIsCurrentVersion(true);
objInfo.setVersionSeriesId(null);
objInfo.setWorkingCopyId(null);