jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: Automatic Mixins
Date Thu, 23 Feb 2006 08:47:01 GMT

On 2/22/06, Daglian, Michael (IT) <Michael.Daglian@morganstanley.com> 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.


Jukka Zitting

Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development
View raw message