Fixed AR-626: Default aspects not being checked for.

- The NodeService was preventing the removal of required aspects
 - This is now enforced by integrity


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3030 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2006-06-05 15:01:25 +00:00
parent 853e7d6cf1
commit 7c17d38207
4 changed files with 136 additions and 19 deletions

View File

@@ -595,20 +595,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
// get the node
Node node = getNodeNotNull(nodeRef);
// check that the aspect may be removed
TypeDefinition nodeTypeDef = dictionaryService.getType(node.getTypeQName());
if (nodeTypeDef == null)
{
throw new InvalidNodeRefException("The node type is no longer valid: " + nodeRef, nodeRef);
}
List<AspectDefinition> defaultAspects = nodeTypeDef.getDefaultAspects();
if (defaultAspects.contains(aspectDef))
{
throw new InvalidAspectException(
"The aspect is a default for the node's type and cannot be removed: " + aspectTypeQName,
aspectTypeQName);
}
// remove the aspect, if present
boolean removed = node.getAspects().remove(aspectTypeQName);
// if the aspect was present, remove the associated properties