Merged BRANCHES/DEV/V3.3-BUG-FIX to HEAD:

22237: Fix ALF-3986: decrement original owner usage (if content deleted by a different user)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22339 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2010-09-08 14:04:02 +00:00
parent 81a22de2d3
commit 8143ba5440
2 changed files with 187 additions and 19 deletions

View File

@@ -367,10 +367,15 @@ public class ContentUsageImpl implements ContentUsageService,
long contentSize = contentData.getSize();
// Get owner/creator
String owner = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_OWNER);
if ((owner == null) || (owner.equals(OwnableService.NO_OWNER)))
String owner = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_ARCHIVED_ORIGINAL_OWNER); // allow for case where someone else is deleting the node
if (owner == null)
{
owner = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_CREATOR);
owner = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_OWNER);
if ((owner == null) || (owner.equals(OwnableService.NO_OWNER)))
{
owner = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_CREATOR);
}
}
if (contentSize != 0 && owner != null)