Fix AR-540.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3075 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana 2006-06-09 17:19:08 +00:00
parent c01c49fbe3
commit acab729d1a

View File

@ -181,6 +181,13 @@ public class NodeImpl extends ItemImpl implements Node
childAssocDef = getNodeTypeChildAssocDefForParent(nodeService, dictionaryService, parentRef, nodeType);
}
// Do not allow creation of sys:base (it's really an abstract type)
// TODO: Consider adding abstract to the content model
if (nodeType.equals(ContentModel.TYPE_BASE))
{
throw new RepositoryException("Node type of node to add is " + nodeType.toPrefixString(session.getNamespaceResolver()) + " which is an abstract type");
}
// Create node
// Note: Integrity exception will be thrown when the node is saved
ChildAssociationRef childRef = nodeService.createNode(parentRef, childAssocDef.getName(), nodeName, nodeType);