You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by un...@apache.org on 2013/11/07 14:46:21 UTC
svn commit: r1539639 -
/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Author: unico
Date: Thu Nov 7 13:46:21 2013
New Revision: 1539639
URL: http://svn.apache.org/r1539639
Log:
JCR-3690 apply patch by Frank van Lankvelt
Modified:
jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
Modified: jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=1539639&r1=1539638&r2=1539639&view=diff
==============================================================================
--- jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java (original)
+++ jackrabbit/branches/2.6/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java Thu Nov 7 13:46:21 2013
@@ -429,40 +429,11 @@ public class NodeTypeRegistry implements
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);
- }
+ // make sure existing content would not conflict
+ // with new node type definition
+ checkForConflictingContent(ntd, diff);
/**
- * the change is trivial and has no effect on current content
- * (e.g. that would be the case when non-mandatory properties had
- * been added);
* re-register node type definition and update caches &
* notify listeners on re-registration
*/
@@ -949,20 +920,37 @@ public class NodeTypeRegistry implements
* the above checks/actions are absolutely necessary in order to
* guarantee integrity of repository content.
*
+ *
* @param ntd The node type definition replacing the former node type
* definition of the same name.
+ * @param diff
* @throws RepositoryException If there is conflicting content or if the
* check failed for some other reason.
*/
- protected void checkForConflictingContent(QNodeTypeDefinition ntd)
+ protected void checkForConflictingContent(QNodeTypeDefinition ntd, final NodeTypeDefDiff diff)
throws RepositoryException {
+
+ if (!diff.isTrivial()) {
+ /**
+ * collect names of node types that have dependencies on the given
+ * node type
+ */
+ //Set dependentNTs = getDependentNodeTypes(ntd.getName());
+
+ 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);
+ }
+
/**
- * collect names of node types that have dependencies on the given
- * node type
+ * the change is trivial and has no effect on current content
+ * (e.g. that would be the case when non-mandatory properties had
+ * been added);
*/
- //Set dependentNTs = getDependentNodeTypes(ntd.getName());
-
- throw new RepositoryException("not yet implemented");
}
/**