// write object
String contentSrc = null;
if (info.hasContent()) {
UrlBuilder contentSrcBuilder = compileUrlBuilder(baseUrl, RESOURCE_CONTENT, info.getId());
if (info.getFileName() != null) {
contentSrcBuilder.addPathSegment(info.getFileName());
}
contentSrc = contentSrcBuilder.toString();
}
entry.writeObject(object, info, contentSrc, info.getContentType(), pathSegment, relativePathSegment);
// write links
entry.writeServiceLink(baseUrl.toString(), repositoryId);
entry.writeSelfLink(compileUrl(baseUrl, RESOURCE_ENTRY, info.getId()), info.getId());
entry.writeEnclosureLink(compileUrl(baseUrl, RESOURCE_ENTRY, info.getId()));
entry.writeEditLink(compileUrl(baseUrl, RESOURCE_ENTRY, info.getId()));
entry.writeDescribedByLink(compileUrl(baseUrl, RESOURCE_TYPE, info.getTypeId()));
entry.writeAllowableActionsLink(compileUrl(baseUrl, RESOURCE_ALLOWABLEACIONS, info.getId()));
if (info.hasParent()) {
entry.writeUpLink(compileUrl(baseUrl, RESOURCE_PARENTS, info.getId()), Constants.MEDIATYPE_FEED);
}
if (info.getBaseType() == BaseTypeId.CMIS_FOLDER) {
entry.writeDownLink(compileUrl(baseUrl, RESOURCE_CHILDREN, info.getId()), Constants.MEDIATYPE_FEED);
if (info.supportsDescendants()) {
entry.writeDownLink(compileUrl(baseUrl, RESOURCE_DESCENDANTS, info.getId()),
Constants.MEDIATYPE_DESCENDANTS);
}
if (info.supportsFolderTree()) {
entry.writeFolderTreeLink(compileUrl(baseUrl, RESOURCE_FOLDERTREE, info.getId()));
}
}
if (info.getVersionSeriesId() != null) {
UrlBuilder vsUrl = compileUrlBuilder(baseUrl, RESOURCE_VERSIONS, info.getId());
vsUrl.addParameter(Constants.PARAM_VERSION_SERIES_ID, info.getVersionSeriesId());
entry.writeVersionHistoryLink(vsUrl.toString());
}
if (!info.isCurrentVersion()) {
UrlBuilder cvUrl = compileUrlBuilder(baseUrl, RESOURCE_ENTRY, info.getId());
cvUrl.addParameter(Constants.PARAM_RETURN_VERSION, ReturnVersion.LATEST);
entry.writeEditLink(cvUrl.toString());
}
if (info.getBaseType() == BaseTypeId.CMIS_DOCUMENT) {
entry.writeEditMediaLink(compileUrl(baseUrl, RESOURCE_CONTENT, info.getId()), info.getContentType());
}
if (info.getWorkingCopyId() != null) {
entry.writeWorkingCopyLink(compileUrl(baseUrl, RESOURCE_ENTRY, info.getWorkingCopyId()));
}
if (info.getWorkingCopyOriginalId() != null) {
entry.writeViaLink(compileUrl(baseUrl, RESOURCE_ENTRY, info.getWorkingCopyOriginalId()));
}
if (info.getRenditionInfos() != null) {
for (RenditionInfo ri : info.getRenditionInfos()) {
UrlBuilder rurl = compileUrlBuilder(baseUrl, RESOURCE_CONTENT,
info.getId());
rurl.addParameter(Constants.PARAM_STREAM_ID, ri.getId());
entry.writeAlternateLink(rurl.toString(), ri.getContenType(),
ri.getKind(), ri.getTitle(), ri.getLength());
}
}
if (info.hasAcl()) {