Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-826

Unable to register node type definition if its primary item name is only handled by a residual child/property definition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.1.0.Final
    • 2.0.0.Final
    • JCR
    • 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.

            rhauch Randall Hauch (Inactive)
            rhauch Randall Hauch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: