You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Alessandro Cosenza <al...@itkey.it> on 2009/01/27 15:56:49 UTC

CND file and Node.addMixin questions

hi 
my cnd file contains a nodetype definition
[dms:document] > mix:versionable

when i create a node
addedNode = parent.addNode("document","dms:document");
the versionable mixin type is added immediately or
i have to call addedNode.addMixin("mix:versionable") ?

another question, could i add another mixin type to a node
which is not specified in cnd file?
for example addedNode.addMixin("mix:lockable") ?

thanks



Re: CND file and Node.addMixin questions

Posted by Stefan Guggisberg <st...@gmail.com>.
hi alessandro

On Tue, Jan 27, 2009 at 3:56 PM, Alessandro Cosenza
<al...@itkey.it> wrote:
> hi
> my cnd file contains a nodetype definition
> [dms:document] > mix:versionable
>
> when i create a node
> addedNode = parent.addNode("document","dms:document");
> the versionable mixin type is added immediately or
> i have to call addedNode.addMixin("mix:versionable") ?

since the primary type dms:document already extends mix:versionable,
there's no need to add that mixin explicitly by caling addMixin.

>
> another question, could i add another mixin type to a node
> which is not specified in cnd file?
> for example addedNode.addMixin("mix:lockable") ?

sure. mix:lockable is a predefined built-in node type.
please note that the cnd file is just a format for specifying
custom node types. it does not directly relate to the available,
i.e. registered node types.

cheers
stefan

>
> thanks
>
>
>