Big honkin' merge from head. Sheesh!

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3617 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-08-27 01:01:30 +00:00
parent e2c66899cc
commit 8031cc6574
322 changed files with 20776 additions and 6550 deletions

View File

@@ -21,14 +21,10 @@ import java.util.List;
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Event to check the association target role name
@@ -37,8 +33,6 @@ import org.apache.commons.logging.LogFactory;
*/
public class AssocTargetRoleIntegrityEvent extends AbstractIntegrityEvent
{
private static Log logger = LogFactory.getLog(AssocTargetRoleIntegrityEvent.class);
public AssocTargetRoleIntegrityEvent(
NodeService nodeService,
DictionaryService dictionaryService,
@@ -51,7 +45,6 @@ public class AssocTargetRoleIntegrityEvent extends AbstractIntegrityEvent
public void checkIntegrity(List<IntegrityRecord> eventResults)
{
NodeRef sourceNodeRef = getNodeRef();
QName assocTypeQName = getTypeQName();
QName assocQName = getQName();
@@ -80,7 +73,6 @@ public class AssocTargetRoleIntegrityEvent extends AbstractIntegrityEvent
// perform required checks
checkAssocQNameRegex(eventResults, childAssocDef, assocQName);
checkAssocQNameDuplicate(eventResults, childAssocDef, sourceNodeRef, assocQName);
}
/**
@@ -108,39 +100,4 @@ public class AssocTargetRoleIntegrityEvent extends AbstractIntegrityEvent
}
}
}
/**
* Checks that the association name matches the constraints imposed by the model.
*/
protected void checkAssocQNameDuplicate(
List<IntegrityRecord> eventResults,
ChildAssociationDefinition assocDef,
NodeRef sourceNodeRef,
QName assocQName)
{
if (assocDef.getDuplicateChildNamesAllowed())
{
// nothing to do
return;
}
QName assocTypeQName = assocDef.getName();
// see if there is another association with the same name
try
{
List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(sourceNodeRef, assocTypeQName, assocQName);
// duplicates not allowed
if (childAssocs.size() > 1)
{
IntegrityRecord result = new IntegrityRecord(
"Duplicate child associations are not allowed: \n" +
" Association: " + assocDef + "\n" +
" Name: " + assocQName);
eventResults.add(result);
}
}
catch (InvalidNodeRefException e)
{
// node has gone
}
}
}