return updatedContentVersionVO;
}
public ContentVersionVO update(Integer contentVersionId, ContentVersionVO contentVersionVO, InfoGluePrincipal principal, Database db) throws Exception
{
ContentVersion contentVersion = getMediumContentVersionWithId(contentVersionId, db);
ContentVO contentVO = ContentController.getContentController().getContentVOWithId(contentVersion.getValueObject().getContentId(), db);
ContentTypeDefinitionVO contentTypeDefinitionVO = ContentTypeDefinitionController.getController().getContentTypeDefinitionVOWithId(contentVO.getContentTypeDefinitionId(), db);
contentVersion.setValueObject(contentVersionVO);
contentVersion.getValueObject().setContentId(contentVO.getContentId());
SiteNodeVersion latestSiteNodeVersion = null;
if(principal != null && contentTypeDefinitionVO.getName().equalsIgnoreCase("Meta info"))
{
SiteNodeVO siteNode = SiteNodeController.getController().getSiteNodeVOWithMetaInfoContentId(db, contentVO.getContentId());
if(siteNode.getMetaInfoContentId() != null && siteNode.getMetaInfoContentId().equals(contentVO.getContentId()))
{
latestSiteNodeVersion = SiteNodeVersionController.getController().getLatestMediumSiteNodeVersion(db, siteNode.getId(), false);
latestSiteNodeVersion.setVersionModifier(contentVersionVO.getVersionModifier());
latestSiteNodeVersion.setModifiedDateTime(DateHelper.getSecondPreciseDate());
SiteNodeVersionControllerProxy.getSiteNodeVersionControllerProxy().acUpdate(principal, latestSiteNodeVersion.getValueObject(), db);
}
}
registryController.updateContentVersionThreaded(contentVersion.getValueObject(), latestSiteNodeVersion == null ? null : latestSiteNodeVersion.getValueObject());
return contentVersion.getValueObject();
}