Merged V3.0 to HEAD

11489: Added step for JDBC info
   11490: Fixed: ETHREEOH-452 Error appear when a user trying to view metadata for item, which is deleting
   11491: Blog integration package rename and removal of obsolete web-client beans
   11492: Adding missing web-extension dir to dynamic-website project
   11493: ETHREEOH_520: Fixes to prevent new users from being created when existing users invited to a site
   11494: Updated version to beta2
   11495: Fixes ETHREEOH-252, 392 & 393. When merged to 2.2 will also fix ETWOTWO-246 & 616 and when merged to HEAD will fix ALFCOM-1685 & 1712. 
   11496: Partial fix for ETHREEOH-27, fixes 2 out of the final 3 error conditions.
   11497: Fix for ETHREEOH-550

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12447 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-12-17 13:28:44 +00:00
parent afc473ec7f
commit 4669d51678
15 changed files with 127 additions and 21 deletions

View File

@@ -27,6 +27,7 @@ package org.alfresco.repo.node.integrity;
import java.util.List;
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@@ -136,6 +137,23 @@ public class AssocSourceMultiplicityIntegrityEvent extends AbstractIntegrityEven
// it is not mandatory and it allows many on both sides of the assoc
return;
}
// check the target of the association if this is a delete
if (isDelete)
{
// get the class the association is defined for and see if it is an aspect
ClassDefinition classDef = assocDef.getTargetClass();
if (classDef.isAspect())
{
// see if the target node has the aspect applied, if it does not
// there's no need to check multiplicity
if (!this.nodeService.hasAspect(targetNodeRef, classDef.getName()))
{
return;
}
}
}
int actualSize = 0;
if (assocDef.isChild())
{
@@ -152,6 +170,7 @@ public class AssocSourceMultiplicityIntegrityEvent extends AbstractIntegrityEven
List<AssociationRef> sourceAssocRefs = nodeService.getSourceAssocs(targetNodeRef, assocTypeQName);
actualSize = sourceAssocRefs.size();
}
if ((mandatory && actualSize == 0) || (!allowMany && actualSize > 1))
{
String parentOrSourceStr = (assocDef.isChild() ? "parent" : "source");