i have defined two node types:

icalendar:component
|
|--icalendar:calendar

(see below for spec notation and NodeTypeReader xml)

each node type includes a residual child node definition distinguished by default primary type and required primary type.

when i try to register these node types, i get the following exception:

=======

org.apache.jackrabbit.core.nodetype.NodeTypeConflictException: A child node definition in node type '{http://osafoundation.org/jcr/icalendar/1.0}component' conflicts with node type '{http://osafoundation.org/jcr/icalendar/1.0}calendar': ambiguous residual child node definition at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.internalMerge(EffectiveNodeType.java:1041) at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.create(EffectiveNodeType.java:175) at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.validateNodeTypeDef(NodeTypeRegistry.java:788)
        ... 30 more

========

when i change the definitions so that icalendar:calendar does not extend icalendar:component but rather includes both residual child node definitions, the node types both register successfully.

i don't see anything in section 6.7.15 of the spec that describes this situation. am i missing something that would make me understand why i'm getting this error, or is it perhaps a bug?

=========

NodeTypeName
  icalendar:component
SuperTypes
  nt:base
IsMixin
  false
HasOrderableChildNodes
  false
PrimaryItemName
  null
ChildNodeDef
  Name *
  RequiredPrimaryTypes [icalendar:xproperty]
  DefaultPrimaryType icalendar:xproperty
  AutoCreate false
  Mandatory false
  OnParentVersion VERSION
  Protected false
  SameNamedSibs true

NodeTypeName
  icalendar:calendar
SuperTypes
  icalendar:component
IsMixin
  false
HasOrderableChildNodes
  false
PrimaryItemName
  null
ChildNodeDef
  Name *
  RequiredPrimaryTypes [icalendar:component]
  DefaultPrimaryType null
  AutoCreate false
  Mandatory false
  OnParentVersion VERSION
  Protected false
  SameNamedSibs true

=========

<nodeType hasOrderableChildNodes="false" isMixin="false"
          name="icalendar:component" primaryItemName="">
  <supertypes>
    <supertype>nt:base</supertype>
  </supertypes>
  <childNodeDefinition autoCreated="false"
                       defaultPrimaryType="icalendar:xproperty"
                       mandatory="false" name="*"
                       onParentVersion="VERSION" protected="false"
                       sameNameSiblings="true">
    <requiredPrimaryTypes>
      <requiredPrimaryType>icalendar:xproperty</requiredPrimaryType>
    </requiredPrimaryTypes>
  </childNodeDefinition>
</nodeType>

<nodeType hasOrderableChildNodes="false" isMixin="false"
          name="icalendar:calendar" primaryItemName="">
  <supertypes>
    <supertype>icalendar:component</supertype>
  </supertypes>
  <childNodeDefinition autoCreated="false" defaultPrimaryType=""
                       mandatory="false" name="*"
                       onParentVersion="VERSION" protected="false"
                       sameNameSiblings="true">
    <requiredPrimaryTypes>
      <requiredPrimaryType>icalendar:component</requiredPrimaryType>
    </requiredPrimaryTypes>
  </childNodeDefinition>
</nodeType>

Reply via email to