You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Alexandru Popescu <th...@gmail.com> on 2005/12/02 19:45:30 UTC

mixins and nodes

Hi!

I was asking myself (and searching through the spec, but I couldn't figure out the answer yet):
- if I have node of a specified type: let's call it test:somenode and after creating an instance I 
add to it a mixin: mixin:testmixin than all nodes of type test:somenode will have this mixing or 
only that specific instance?

thanks in advance,

./alex
--
.w( the_mindstorm )p.

Re: mixins and nodes

Posted by Dominique Jaeggi <do...@day.com>.
a mixin nodetype is explicitely assigned to a node as part of its 
jcr:mixinTypes multi-value property. therefore only that one node 
carries the additional node type. the spec states:

6.7.4 Primary and Mixin Node Types
In a content repository, every node has one and only one primary node 
type. This node type defines, as mentioned, a set of restrictions on the 
child items of the node.
In addition to its single primary node type, a node may also have any 
number of mixin node types assigned to it. A mixin type is similar to a 
primary type in that its definition has the same parameters. It differs, 
though, in that it provides additional features to a node, beyond those 
defined in the node type proper.
Furthermore, while a primary node type can be “instantiated” as a node 
(i.e., that node’s structure is fully defined by its primary node type) 
this is not the case with mixin types. A mixin type cannot serve, by 
itself, to define the structure of a node; it just adds properties and 
child node requirements to a node that already has a primary node type.
A particular supported node type is either a primary type or a mixin 
type; it cannot be both.

dom.

Alexandru Popescu wrote:

> Hi!
>
> I was asking myself (and searching through the spec, but I couldn't 
> figure out the answer yet):
> - if I have node of a specified type: let's call it test:somenode and 
> after creating an instance I add to it a mixin: mixin:testmixin than 
> all nodes of type test:somenode will have this mixing or only that 
> specific instance?
>
> thanks in advance,
>
> ./alex
> -- 
> .w( the_mindstorm )p.