Merged V3.1 to HEAD

- incl. taking Hibernate libs from 3.1 and adding missing file from earlier merge
   13321: Fix ETHREEOH-1407: System error occur during "Undo Selected" action if no items are selected
   13322: ETHREEOH-1206: Throwing Alfresco Exception on OnUpdateProperties behaviour resets Encoding field to Big (first entry)
   13326: (RECORD ONLY) Removed 'dev' from version label.
   13330: Fix ETHREEOH-1408: Incorrect button name at "Manage Task: Submitted" page
   13337: Fix for ETHREEOH-1409 and further fix for ETHREEOH-1408
   13338: Removed svn:mergeinfo
   13346: Make startup bat script check JAVA can be found.
   13351: ETHREEOH-1386 validate ASR and FSR hostname.
   13359: ETHREEOH-1435: Share doesn't extract document metadata correctly
   13360: Fix ETHREEOH-821: SDK dependencies
   13369: Fixed distribute-sdk target for when it's run locally
   13382: ETHREEOH-1437: Container creation induces an unexpected permission allocation in Share
   13391: Shutdown backstop continues if logging throws errors.
   13394: Fix ETHREEOH-1457 - MT coci issue with bootstrap (eg. data dictionary) content
   13400: Activate JAWS-223: Adobe LC Hibernate Dialect Loading
   13401: Support for JAWS-215, mysql and oracle
   13413: Fix ETHREEOH-1458 - MT delete->archive
   ___________________________________________________________________
   Modified: svn:mergeinfo
      Merged /alfresco/BRANCHES/V3.1:r
                           13321-13322,13326-13327,13330,13337-13339,13341-13347,13351,13354-13355,13358-13363,
                           13365,13367,13369,13382,13385-13392,13394,13400-13403,13405-13406,13413


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2009-03-13 00:51:43 +00:00
parent 9d65d8feec
commit fec1149d8c
18 changed files with 297 additions and 117 deletions

View File

@@ -344,7 +344,7 @@ public class ContentUsageImpl implements ContentUsageService,
private void incrementUserUsage(String userName, long contentSize, NodeRef contentNodeRef)
{
if (! userName.equals(authenticationComponent.getSystemUserName()))
if (! authenticationComponent.isSystemUserName(userName))
{
// increment usage - add positive delta
if (logger.isDebugEnabled()) logger.debug("incrementUserUsage: username="+userName+", contentSize="+contentSize+", contentNodeRef="+contentNodeRef);
@@ -366,14 +366,17 @@ public class ContentUsageImpl implements ContentUsageService,
throw new ContentQuotaException("User quota exceeded");
}
NodeRef personNodeRef = personService.getPerson(userName);
usageService.insertDelta(personNodeRef, contentSize);
NodeRef personNodeRef = getPerson(userName);
if (personNodeRef != null)
{
usageService.insertDelta(personNodeRef, contentSize);
}
}
}
private void decrementUserUsage(String userName, long contentSize, NodeRef contentNodeRef)
{
if (! userName.equals(authenticationComponent.getSystemUserName()))
if (! authenticationComponent.isSystemUserName(userName))
{
// decrement usage - add negative delta
if (logger.isDebugEnabled()) logger.debug("decrementUserUsage: username="+userName+", contentSize="+contentSize+", contentNodeRef="+contentNodeRef);
@@ -390,8 +393,11 @@ public class ContentUsageImpl implements ContentUsageService,
}
}
NodeRef personNodeRef = personService.getPerson(userName);
usageService.insertDelta(personNodeRef, (-contentSize));
NodeRef personNodeRef = getPerson(userName);
if (personNodeRef != null)
{
usageService.insertDelta(personNodeRef, (-contentSize));
}
}
}
@@ -424,7 +430,7 @@ public class ContentUsageImpl implements ContentUsageService,
{
long currentUsage = -1;
NodeRef personNodeRef = personService.getPerson(userName);
NodeRef personNodeRef = getPerson(userName);
if (personNodeRef != null)
{
currentUsage = getUserStoredUsage(personNodeRef);
@@ -457,7 +463,7 @@ public class ContentUsageImpl implements ContentUsageService,
*/
public void setUserQuota(String userName, long currentQuota)
{
NodeRef personNodeRef = personService.getPerson(userName);
NodeRef personNodeRef = getPerson(userName);
if (personNodeRef != null)
{
nodeService.setProperty(personNodeRef, ContentModel.PROP_SIZE_QUOTA, new Long(currentQuota));
@@ -468,7 +474,7 @@ public class ContentUsageImpl implements ContentUsageService,
{
Long currentQuota = null;
NodeRef personNodeRef = personService.getPerson(userName);
NodeRef personNodeRef = getPerson(userName);
if (personNodeRef != null)
{
currentQuota = (Long)nodeService.getProperty(personNodeRef, ContentModel.PROP_SIZE_QUOTA);
@@ -481,4 +487,27 @@ public class ContentUsageImpl implements ContentUsageService,
{
return enabled;
}
private NodeRef getPerson(String userName)
{
NodeRef personNodeRef = null;
try
{
personNodeRef = personService.getPerson(userName);
}
catch (RuntimeException e)
{
// workaround for ETHREEOH-1457 where existing tenants (created using 3.0.1) may have been bootstrapped with creator set
// to super admin (eg. "admin") rather than "System@xxx". This workaround should remain until we patch any such existing tenants
if (tenantService.isEnabled())
{
personNodeRef = null;
}
else
{
throw e;
}
}
return personNodeRef;
}
}