/**
* build diff of current and new definition and determine type of change
*/
QNodeTypeDefinition ntdOld = registeredNTDefs.get(name);
NodeTypeDefDiff diff = NodeTypeDefDiff.create(ntdOld, ntd);
if (!diff.isModified()) {
// the definition has not been modified, there's nothing to do here...
return getEffectiveNodeType(name);
}
if (!diff.isTrivial()) {
// TODO Implement checkForConflictingContent()
// make sure existing content would not conflict
// with new node type definition
//checkForConflictingContent(ntd);
//
// unregister old node type definition
//internalUnregister(name);
// register new definition
//EffectiveNodeType entNew = internalRegister(ntd);
//
// persist modified node type definitions
//customNTDefs.remove(name);
//customNTDefs.add(ntd);
//persistCustomNodeTypeDefs(customNTDefs);
//
// notify listeners
//notifyReRegistered(name);
//return entNew;
String message =
"The following node type change contains non-trivial changes."
+ "Up until now only trivial changes are supported."
+ " (see javadoc for "
+ NodeTypeDefDiff.class.getName()
+ "):\n" + diff.toString();
throw new RepositoryException(message);
}
/**
* the change is trivial and has no effect on current content