Hi,

On 2/22/06, Daglian, Michael (IT) <[EMAIL PROTECTED]> wrote:
> I was curious if it's possible to automatically associate mixins with a
> given primary node type.

Yes. Your approach of adding the mixin types as supertypes of a
primary node type is the correct one.

> Using a mixin as a supertype seems to properly associated the
> required properties (and responds true to Node.isNodeType(mix:type)
> but does not set the jcr:mixinTypes property nor expose nodes of that
> primary type when using queries of the form //element(*, mix:type).

Section 6.7.5 of the JCR specification states (with the emphasis) that:

    Note that the mixin node types listed in the jcr:mixinTypes
    property are those that have been *explicitly assigned* (using
    Node.addMixin) to a node. It does not include mixin types that
    may be among the supertypes of a node's primary type.

Thus Jackrabbit is correct in not exposing such mixin types in the
jcr:mixinTypes property. However I believe that there is an error with
//element(*, mix:type). AFAIK the query should match the correct nodes
even if the given type is a (mixin) supertype. You may want to file a
bug report in Jira about this.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - [EMAIL PROTECTED]
Software craftsmanship, JCR consulting, and Java development

Reply via email to