-
Bug
-
Resolution: Done
-
Major
-
2.0.0.Final
-
None
-
Low
It is not possible to create a node type definition template with only a residual property or child node definition (e.g., "*") and a non-empty primary item name. Per section 3.7.1.7 of the JCR 2.0 specification:
"A node type can declare one of its child items as primary, meaning that for all nodes of that type, that child item is accessible through a dedicated API method which does not require the name of the item. (see §5.1.7 Primary Item Access). This feature can help generic API clients intelligently traverse an unknown node structure. The primary item may be an item name, which must be a JCR name, or null, meaning that there is no primary item."
And then Section 5.1.7 is:
"If a primary child item is specified by the node type of a node, this item can be retrieved directly from the node with 'Item Node.getPrimaryItem()'. See §3.7.1.7 Primary Item."
There is nothing in the spec that dictates how to validate the primary item name. But ModeShape's node type manager requires that the primary item name reflect an existing child node definition.