Index: modeshape-jcr/src/main/java/org/modeshape/jcr/AbstractJcrNode.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/AbstractJcrNode.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/AbstractJcrNode.java (working copy)
@@ -889,10 +889,17 @@ abstract class AbstractJcrNode extends AbstractJcrItem implements javax.jcr.Node
NodeType primaryType = this.getPrimaryNodeType();
NodeType[] mixinTypes = this.getMixinNodeTypes();
+ if (mixinCandidateType.isAbstract()) {
+ return false;
+ }
+
if (!mixinCandidateType.isMixin()) {
return false;
}
+ /* MODE FLAG - Needs to be uncommented for JCR 2 */
+ // if (isNodeType(mixinCandidateType.getInternalName())) return true;
+
if (mixinCandidateType.conflictsWith(primaryType, mixinTypes)) {
return false;
}
@@ -978,6 +985,8 @@ abstract class AbstractJcrNode extends AbstractJcrItem implements javax.jcr.Node
throw new ConstraintViolationException(JcrI18n.cannotAddMixin.text(mixinName));
}
+ if (isNodeType(mixinName)) return;
+
this.editor().addMixin(mixinCandidateType);
}
@@ -1007,17 +1016,8 @@ abstract class AbstractJcrNode extends AbstractJcrItem implements javax.jcr.Node
throw new VersionException(JcrI18n.nodeIsCheckedIn.text(getPath()));
}
- /*
- * This is a special workaround for o.a.j.test.api.version.VersionText.testRemoveMixin().
- * This test tries to remove the mix:versionable mixin from a node with the primary type
- * nt:version and no mixin types. It expects a ConstraintViolationException (because nt:version nodes
- * are protected) instead of a NoSuchNodeTypeException (because the node doesn't have that mixin).
- *
- * Interestingly, o.a.j.test.api.version.VersionHistoryTest.testRemoveMixin tries to remove
- * mix:versionable from a nt:versionHistory node, but accepts either a CVE or a NSNTE.
- */
- if (JcrMixLexicon.VERSIONABLE.getString(context().getNamespaceRegistry()).equals(mixinName)) {
- throw new ConstraintViolationException(JcrI18n.cannotRemoveMixVersionable.text(getPath()));
+ if (getDefinition().isProtected()) {
+ throw new ConstraintViolationException(JcrI18n.cannotRemoveFromProtectedNode.text(getPath()));
}
Property existingMixinProperty = getProperty(JcrLexicon.MIXIN_TYPES);
@@ -1122,6 +1122,39 @@ abstract class AbstractJcrNode extends AbstractJcrItem implements javax.jcr.Node
}
/**
+ * Attempts to change the primary type of this node. Not yet supported, but some error checking is added.
+ *
+ * @param nodeTypeName the name of the new primary type for this node
+ * @throws NoSuchNodeTypeException if no node with the given name exists
+ * @throws VersionException if this node is versionable and checked-in or is non-versionable but its nearest versionable
+ * ancestor is checked-in.
+ * @throws ConstraintViolationException if existing child nodes or properties (or the lack of sufficient child nodes or
+ * properties) prevent this node from satisfying the definition of the new primary type
+ * @throws LockException if a lock prevents the modification of the primary type
+ * @throws RepositoryException if any other error occurs
+ */
+ public void setPrimaryType( String nodeTypeName )
+ throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException {
+
+ if (this.isLocked() && !holdsLock()) {
+ throw new LockException(JcrI18n.lockTokenNotHeld.text(this.location));
+ }
+
+ if (!isCheckedOut()) {
+ throw new VersionException(JcrI18n.nodeIsCheckedIn.text(getPath()));
+ }
+
+ JcrNodeType nodeType = session().nodeTypeManager().getNodeType(nodeTypeName);
+
+ if (nodeType.equals(getPrimaryNodeType())) return;
+
+ if (nodeType.isMixin()) {
+ throw new ConstraintViolationException(JcrI18n.cannotUseMixinTypeAsPrimaryType.text(nodeTypeName));
+ }
+
+ throw new ConstraintViolationException(JcrI18n.setPrimaryTypeNotSupported.text());
+ }
+ /**
* {@inheritDoc}
*
* @see javax.jcr.Node#addNode(java.lang.String)
@@ -1293,6 +1326,10 @@ abstract class AbstractJcrNode extends AbstractJcrItem implements javax.jcr.Node
// Determine the name for the primary node type
if (primaryNodeTypeName != null) {
if (!session().nodeTypeManager().hasNodeType(primaryNodeTypeName)) return false;
+
+ JcrNodeType nodeType = session().nodeTypeManager().getNodeType(primaryNodeTypeName);
+ if (nodeType.isAbstract()) return false;
+ if (nodeType.isMixin()) return false;
}
return true;
Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrI18n.java (working copy)
@@ -192,6 +192,9 @@ public final class JcrI18n {
public static I18n cannotAddMixin;
public static I18n invalidMixinTypeForNode;
public static I18n notOrderable;
+ public static I18n cannotUseMixinTypeAsPrimaryType;
+ public static I18n primaryTypeCannotBeAbstract;
+ public static I18n setPrimaryTypeNotSupported;
// Lock messages
public static I18n nodeNotLockable;
@@ -210,7 +213,7 @@ public final class JcrI18n {
// Versioning messages
public static I18n nodeIsCheckedIn;
- public static I18n cannotRemoveMixVersionable;
+ public static I18n cannotRemoveFromProtectedNode;
public static I18n cannotRemoveVersion;
public static I18n pendingMergeConflicts;
public static I18n invalidVersion;
Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeType.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeType.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeType.java (working copy)
@@ -254,6 +254,13 @@ class JcrNodeType implements NodeType {
CheckArg.isNotNull(primaryNodeTypeName, "primaryNodeTypeName");
Name childName = context.getValueFactories().getNameFactory().create(childNodeName);
Name childPrimaryTypeName = context.getValueFactories().getNameFactory().create(primaryNodeTypeName);
+
+ if (primaryNodeTypeName != null) {
+ JcrNodeType childType = this.nodeTypeManager().getNodeType(childPrimaryTypeName);
+ if (childType.isAbstract() || childType.isMixin()) return false;
+
+ }
+
return nodeTypeManager().findChildNodeDefinition(this.name, null, childName, childPrimaryTypeName, 0, true) != null;
}
Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeManager.java (working copy)
@@ -26,6 +26,7 @@ package org.modeshape.jcr;
import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import javax.jcr.AccessDeniedException;
import javax.jcr.PropertyType;
@@ -524,12 +525,25 @@ public class JcrNodeTypeManager implements NodeTypeManager {
}
/**
+ * Unregisters the named node type if it is not referenced by other node types as a supertype, a default primary type of a
+ * child node (or nodes), or a required primary type of a child node (or nodes).
+ *
+ * @param nodeTypeName
+ * @throws NoSuchNodeTypeException if node type name does not correspond to a registered node type
+ * @throws InvalidNodeTypeDefinitionException if the node type with the given name cannot be unregistered because it is the
+ * supertype, one of the required primary types, or a default primary type of another node type
+ * @throws AccessDeniedException if the current session does not have the {@link ModeShapePermissions#REGISTER_TYPE register
+ * type permission}.
+ * @throws RepositoryException if any other error occurs
+ */
+ public void unregisterNodeType( String nodeTypeName )
+ throws NoSuchNodeTypeException, InvalidNodeTypeDefinitionException, RepositoryException {
+ unregisterNodeType(Collections.singleton(nodeTypeName));
+ }
+
+ /**
* Allows the collection of node types to be unregistered if they are not referenced by other node types as supertypes,
* default primary types of child nodes, or required primary types of child nodes.
- *
- * NOTE: This method does not check to see if any of the node types are currently being used. Unregistering a node type
- * that is being used will cause the system to become unstable
- *
*
* @param nodeTypeNames the names of the node types to be unregistered
* @throws NoSuchNodeTypeException if any of the node type names do not correspond to a registered node type
Index: modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeTemplate.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeTemplate.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/JcrNodeTypeTemplate.java (working copy)
@@ -92,8 +92,18 @@ public class JcrNodeTypeTemplate implements NodeTypeTemplate {
* {@inheritDoc}
*
* @see org.modeshape.jcr.nodetype.NodeTypeTemplate#setDeclaredSupertypeNames(java.lang.String[])
+ * @deprecated Use {@link #setDeclaredSuperTypeNames(String[])} instead
*/
public void setDeclaredSupertypeNames( String[] names ) {
+ setDeclaredSuperTypeNames(names);
+ }
+
+ /**
+ * Set the direct supertypes for this node type.
+ *
+ * @param names the names of the direct supertypes, or empty or null if there are none.
+ */
+ public void setDeclaredSuperTypeNames( String[] names ) {
CheckArg.isNotNull(names, "names");
this.declaredSupertypeNames = names;
}
@@ -141,7 +151,12 @@ public class JcrNodeTypeTemplate implements NodeTypeTemplate {
* @see org.modeshape.jcr.nodetype.NodeTypeDefinition#getDeclaredNodeDefinitions()
*/
public NodeDefinition[] getDeclaredNodeDefinitions() {
- return null; // per JSR-283 specification (section 4.7.10)
+ return getDeclaredChildNodeDefinitions();
+ }
+
+ public NodeDefinition[] getDeclaredChildNodeDefinitions() {
+ if (this.nodeDefinitionTemplates == null) return null;
+ return nodeDefinitionTemplates.toArray(new NodeDefinition[nodeDefinitionTemplates.size()]);
}
/**
@@ -150,15 +165,26 @@ public class JcrNodeTypeTemplate implements NodeTypeTemplate {
* @see org.modeshape.jcr.nodetype.NodeTypeDefinition#getDeclaredPropertyDefinitions()
*/
public PropertyDefinition[] getDeclaredPropertyDefinitions() {
- return null; // per JSR-283 specification (section 4.7.10)
+ if (this.propertyDefinitionTemplates == null) return null;
+ return propertyDefinitionTemplates.toArray(new PropertyDefinition[propertyDefinitionTemplates.size()]);
}
/**
* {@inheritDoc}
*
* @see org.modeshape.jcr.nodetype.NodeTypeDefinition#getDeclaredSupertypes()
+ * @deprecated Use {@link #getDeclaredSuperTypeNames()} instead
*/
public String[] getDeclaredSupertypes() {
+ return getDeclaredSuperTypeNames();
+ }
+
+ /**
+ * Get the direct supertypes for this node type.
+ *
+ * @return the names of the direct supertypes, or an empty array if there are none
+ */
+ public String[] getDeclaredSuperTypeNames() {
return declaredSupertypeNames;
}
@@ -225,4 +251,5 @@ public class JcrNodeTypeTemplate implements NodeTypeTemplate {
this.queryable = queryable;
}
+
}
Index: modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryNodeTypeManager.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryNodeTypeManager.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/RepositoryNodeTypeManager.java (working copy)
@@ -1948,29 +1948,41 @@ class RepositoryNodeTypeManager {
assert nodeType != null;
Property supertypesProperty = nodeType.getProperty(JcrLexicon.SUPERTYPES);
+ Object[] supertypesArray;
// If no supertypes are provided, assume nt:base as a supertype
if (supertypesProperty == null || supertypesProperty.size() == 0) {
- Property isMixinProperty = nodeType.getProperty(JcrLexicon.IS_MIXIN);
- boolean isMixin = isMixinProperty != null && Boolean.valueOf(isMixinProperty.getFirstValue().toString());
- JcrNodeType supertype = findTypeInMapOrList(JcrNtLexicon.BASE, pendingTypes);
- // We register nt:base at startup now instead of just injecting it
- if (supertype == null || isMixin) {
- return Collections.emptyList();
- }
- return Collections.singletonList(supertype);
+ supertypesArray = new Object[0];
+ } else {
+ supertypesArray = supertypesProperty.getValuesAsArray();
}
+ List supertypes = new LinkedList();
- Object[] supertypesArray = supertypesProperty.getValuesAsArray();
- List supertypes = new ArrayList(supertypesArray.length);
+ Property isMixinProperty = nodeType.getProperty(JcrLexicon.IS_MIXIN);
+ boolean isMixin = isMixinProperty != null && Boolean.valueOf(isMixinProperty.getFirstValue().toString());
+ boolean needsPrimaryAncestor = !isMixin;
for (int i = 0; i < supertypesArray.length; i++) {
- supertypes.add(findTypeInMapOrList((Name)supertypesArray[i], pendingTypes));
-
- if (supertypes.get(i) == null) {
+ JcrNodeType supertype = findTypeInMapOrList((Name)supertypesArray[i], pendingTypes);
+ if (supertype == null) {
Name nodeTypeName = nodeType.getLocation().getPath().getLastSegment().getName();
throw new InvalidNodeTypeDefinitionException(JcrI18n.invalidSupertypeName.text(supertypesArray[i], nodeTypeName));
}
+
+ needsPrimaryAncestor &= supertype.isMixin();
+ supertypes.add(supertype);
+ }
+
+ // primary types (other than nt:base) always have at least one ancestor that's a primary type - nt:base
+ if (needsPrimaryAncestor) {
+ Property nameProperty = nodeType.getProperty(JcrLexicon.NODE_TYPE_NAME);
+ Name nodeName = context.getValueFactories().getNameFactory().create(nameProperty.getFirstValue());
+
+ if (!JcrNtLexicon.BASE.equals(nodeName)) {
+ JcrNodeType ntBase = findTypeInMapOrList(JcrNtLexicon.BASE, pendingTypes);
+ assert ntBase != null;
+ supertypes.add(0, ntBase);
+ }
}
return supertypes;
Index: modeshape-jcr/src/main/java/org/modeshape/jcr/SessionCache.java
===================================================================
--- modeshape-jcr/src/main/java/org/modeshape/jcr/SessionCache.java (revision 1799)
+++ modeshape-jcr/src/main/java/org/modeshape/jcr/SessionCache.java (working copy)
@@ -1504,12 +1504,6 @@ class SessionCache {
workspaceName(),
sourceName());
- nodeTypes().findChildNodeDefinition(payload.getPrimaryTypeName(),
- payload.getMixinTypeNames(),
- name,
- primaryTypeName,
- numSns,
- true);
throw new ConstraintViolationException(msg);
}
@@ -1522,6 +1516,17 @@ class SessionCache {
I18n msg = JcrI18n.unableToCreateNodeWithPrimaryTypeThatDoesNotExist;
throw new NoSuchNodeTypeException(msg.text(primaryTypeName, pathForChild, workspaceName()));
}
+
+ if (primaryType.isMixin()) {
+ I18n msg = JcrI18n.cannotUseMixinTypeAsPrimaryType;
+ throw new ConstraintViolationException(msg.text(primaryType.getName()));
+ }
+
+ if (primaryType.isAbstract()) {
+ I18n msg = JcrI18n.primaryTypeCannotBeAbstract;
+ throw new ConstraintViolationException(msg.text(primaryType.getName()));
+ }
+
} else {
primaryType = (JcrNodeType)definition.getDefaultPrimaryType();
if (primaryType == null) {
Index: modeshape-jcr/src/main/resources/org/modeshape/jcr/JcrI18n.properties
===================================================================
--- modeshape-jcr/src/main/resources/org/modeshape/jcr/JcrI18n.properties (revision 1799)
+++ modeshape-jcr/src/main/resources/org/modeshape/jcr/JcrI18n.properties (working copy)
@@ -178,6 +178,9 @@ cannotUnregisterInUseType=Cannot unregister type '{0}' because it is currently b
cannotAddMixin = This node does not allow adding the mixin type "{0}"
invalidMixinTypeForNode = "{0}" is not currently a mixin type for node "{1}"
notOrderable = The primary type "{0}" for this node (at "{1}") does not have orderable children
+cannotUseMixinTypeAsPrimaryType = This operation requires a primary type, but "{0}" is a mixin type
+primaryTypeCannotBeAbstract = The prrimary type of a node cannot be abstract, like "{0}"
+setPrimaryTypeNotSupported = ModeShape does not currently allow modifying the primary type of a node
# Lock messages
nodeNotLockable = The node at '{0}' is not lockable. Add the 'mix:lockable' mixin type to make it lockable.
@@ -196,7 +199,7 @@ sessionIsNotActive = The session with an ID of '{0}' is no longer active.
# Versioning messages
nodeIsCheckedIn = '{0}' (or its nearest versionable ancestor) is checked in, preventing this action
-cannotRemoveMixVersionable = The 'mix:versionable' node type (or a type that extends it) cannot be removed from the node at '{0}'
+cannotRemoveFromProtectedNode = Mixins cannot be removed from the node at '{0}' because it has a protected node definition
cannotRemoveVersion = This version cannot be removed as the property at '{0}' still references it. Remove that reference and try again.
pendingMergeConflicts = The node at '{0}' cannot be checked in due to existing merge conflicts stored in the 'jcr:mergeFailed property.
invalidVersion = The version at '{0}' is not valid for the version history at '{1}'
Index: modeshape-jcr/src/main/resources/org/modeshape/jcr/jsr_283_builtins.cnd
new file mode 100644
===================================================================
--- /dev/null (revision 1799)
+++ modeshape-jcr/src/main/resources/org/modeshape/jcr/jsr_283_builtins.cnd (working copy)
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+// ------------------------------------------------------------------------
+// Pre-defined Node Types
+// ------------------------------------------------------------------------
+
+[mode:defined] mixin
+- modeint:nodeDefinition (string) protected ignore
+- modeint:multiValuedProperties (string) multiple protected ignore
+
+[nt:base] > mode:defined abstract
+ - jcr:primaryType (name) mandatory autocreated
+ protected compute
+ - jcr:mixinTypes (name) protected multiple compute
+
+[nt:unstructured]
+ orderable
+ - * (undefined) multiple
+ - * (undefined)
+ + * (nt:base) = nt:unstructured multiple version
+
+[mix:created] mixin
+ - jcr:created (date) protected
+ - jcr:createdBy (string) protected
+
+[nt:hierarchyNode] > mix:created abstract
+
+[nt:file] > nt:hierarchyNode
+ + jcr:content (nt:base) primary mandatory
+
+[nt:linkedFile] > nt:hierarchyNode
+ - jcr:content (reference) primary mandatory
+
+[nt:folder] > nt:hierarchyNode
+ + * (nt:hierarchyNode) version
+
+[mix:referenceable] mixin
+ - jcr:uuid (string) mandatory autocreated protected initialize
+
+[mix:mimeType] mixin
+ - jcr:mimeType (string)
+ - jcr:encoding (string)
+
+[mix:lastModified] mixin
+ - jcr:lastModified (date)
+ - jcr:lastModifiedBy (string)
+
+[nt:resource] > mix:referenceable, mix:mimeType, mix:lastModified
+ - jcr:data (binary) primary mandatory
+
+[nt:nodeType]
+ - jcr:nodeTypeName (name) mandatory protected copy
+ - jcr:supertypes (name) multiple protected copy
+ - jcr:isAbstract (boolean) mandatory protected copy
+ - jcr:isMixin (boolean) mandatory protected copy
+ - jcr:isQueryable (boolean) mandatory protected copy
+ - jcr:hasOrderableChildNodes (boolean) mandatory protected copy
+ - jcr:primaryItemName (name) protected copy
+ + jcr:propertyDefinition (nt:propertyDefinition) = nt:propertyDefinition multiple protected copy
+ + jcr:childNodeDefinition (nt:childNodeDefinition) = nt:childNodeDefinition multiple protected copy
+
+[nt:propertyDefinition]
+ - jcr:name (name) protected
+ - jcr:autoCreated (boolean) mandatory protected
+ - jcr:mandatory (boolean) mandatory protected
+ - jcr:isFullTextSearchable (boolean) mandatory protected
+ - jcr:isQueryOrderable (boolean) mandatory protected
+ - jcr:onParentVersion (string) mandatory protected
+ < 'COPY', 'VERSION', 'INITIALIZE', 'COMPUTE',
+ 'IGNORE', 'ABORT'
+ - jcr:protected (boolean) mandatory protected
+ - jcr:requiredType (string) mandatory protected
+ < 'STRING', 'BINARY', 'LONG', 'DOUBLE', 'BOOLEAN',
+ 'DATE', 'NAME', 'PATH', 'REFERENCE', 'UNDEFINED'
+ - jcr:valueConstraints (string) multiple protected
+ - jcr:availableQueryOperators (name) mandatory multiple protected
+ - jcr:defaultValues (undefined) multiple protected
+ - jcr:multiple (boolean) mandatory protected
+
+[nt:childNodeDefinition]
+ - jcr:name (name) protected
+ - jcr:autoCreated (boolean) mandatory protected
+ - jcr:mandatory (boolean) mandatory protected
+ - jcr:onParentVersion (string) mandatory protected
+ < 'COPY', 'VERSION', 'INITIALIZE', 'COMPUTE',
+ 'IGNORE', 'ABORT'
+ - jcr:protected (boolean) mandatory protected
+ - jcr:requiredPrimaryTypes (name) = 'nt:base' mandatory protected multiple
+ - jcr:defaultPrimaryType (name) protected
+ - jcr:sameNameSiblings (boolean) mandatory protected
+
+/* Need full support for weakreference type for jcr:copiedFrom property */
+[nt:versionHistory] > mix:referenceable
+ - jcr:versionableUuid (string) mandatory autocreated protected abort
+ - jcr:copiedFrom (reference) protected abort < 'nt:version'
+ + jcr:rootVersion (nt:version) = nt:version mandatory autocreated protected abort
+ + jcr:versionLabels (nt:versionLabels) = nt:versionLabels mandatory autocreated protected abort
+ + * (nt:version) = nt:version protected abort
+
+
+[nt:versionLabels]
+ - * (reference) protected abort < 'nt:version'
+
+[nt:version] > mix:referenceable
+ - jcr:created (date) mandatory autocreated protected abort
+ - jcr:predecessors (reference) protected multiple abort < 'nt:version'
+ - jcr:successors (reference) protected multiple abort < 'nt:version'
+ - jcr:activity (reference) protected abort < 'nt:activity'
+ + jcr:frozenNode (nt:frozenNode) protected abort
+
+[nt:frozenNode] > mix:referenceable
+ orderable
+ - jcr:frozenPrimaryType (name) mandatory autocreated protected abort
+ - jcr:frozenMixinTypes (name) protected multiple abort
+ - jcr:frozenUuid (string) mandatory autocreated protected abort
+ - * (undefined) protected abort
+ - * (undefined) protected multiple abort
+ + * (nt:base) protected multiple abort
+
+[nt:versionedChild]
+ - jcr:childVersionHistory (reference) mandatory autocreated protected abort < 'nt:versionHistory'
+
+[nt:query]
+ - jcr:statement (string)
+ - jcr:language (string)
+
+[nt:activity] > mix:referenceable
+ - jcr:activityTitle (string) mandatory autocreated protected
+
+
+[mix:simpleVersionable] mixin
+ - jcr:isCheckedOut (boolean) = 'true' mandatory autocreated protected ignore
+
+[mix:versionable] > mix:simpleVersionable, mix:referenceable mixin
+ - jcr:versionHistory (reference) mandatory protected ignore < 'nt:versionHistory'
+ - jcr:baseVersion (reference) mandatory protected ignore < 'nt:version'
+ - jcr:predecessors (reference) mandatory protected multiple ignore < 'nt:version'
+ - jcr:mergeFailed (reference) protected multiple abort
+ - jcr:activity (reference) protected < 'nt:version'
+ - jcr:configuration (reference) protected ignore < 'nt:configuration'
+
+[nt:configuration] > mix:versionable
+ - jcr:root (reference) mandatory autocreated protected
+
+/* Need full support for weakreference type to use this
+[nt:address]
+ - jcr:protocol (string)
+ - jcr:host (string)
+ - jcr:port (string)
+ - jcr:repository (string)
+ - jcr:workspace (string)
+ - jcr:path (path)
+ - jcr:id (weakreference)
+*/
+
+[nt:naturalText]
+ - jcr:text (string)
+ - jcr:messageId (string)
+
+
+// ------------------------------------------------------------------------
+// Pre-defined Mixins
+// ------------------------------------------------------------------------
+
+[mix:lockable] mixin
+ - jcr:lockOwner (string) protected ignore
+ - jcr:lockIsDeep (boolean) protected ignore
+
+[mix:lifecycle] mixin
+ - jcr:lifecyclePolicy (reference) protected initialize
+ - jcr:currentLifecycleState (string) protected initialize
+
+[mix:managedRetention] > mix:referenceable mixin
+ - jcr:hold (string) protected multiple
+ - jcr:isDeep (boolean) protected multiple
+ - jcr:retentionPolicy (reference) protected
+
+[mix:shareable] > mix:referenceable mixin
+
+[mix:title] mixin
+ - jcr:title (string)
+ - jcr:description (string)
+
+[mix:language] mixin
+ - jcr:language (string)
Index: modeshape-jcr/src/test/resources/repositoryStubImpl.properties
===================================================================
--- modeshape-jcr/src/test/resources/repositoryStubImpl.properties (revision 1799)
+++ modeshape-jcr/src/test/resources/repositoryStubImpl.properties (working copy)
@@ -51,6 +51,10 @@ javax.jcr.tck.NodeOrderableChildNodesTest.testOrderBeforeUnsupportedRepositoryOp
javax.jcr.tck.SaveTest.nodetype=nt\:query
javax.jcr.tck.SetPropertyAssumeTypeTest.nodetype=modetest\:setPropertyAssumeTypeTest
+# This test makes the assumption that canAddMixin("foo") implies that removeMixin("foo") will throw a NoSuchNodeTypeException
+# This contradicts the 2.0 test cases and is ill-defined in 1.0.1 anyway
+javax.jcr.tck.NodeRemoveMixinTest.nodetype=nt\:unstructured
+
# Session test that requires a node that doesn't allow two children with the same name
javax.jcr.tck.SessionTest.testMoveItemExistsException.nodetype2=modetest\:noSameNameSibs