You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by hsp <pi...@ibest.com.br> on 2006/03/09 18:43:18 UTC

Custom nodetypes, any simple example?

Hi again;
I need some properties fir the nodes in my repository, that I haven't found in the nodetypes (if they already exists I would appreciate to know).
For example, I need to control some documents with time life, so the properties for this case would be:

my:timelife
        |_   my:timeini
        |_   my:timeend

So, I think the "my:timelife" is mix (?), and the other child nodetypes are Date (I don't know who would be the parent for "my:timelife"). There are some more needs, but with this example I will mind the others.
Could someone mount a simple xml example with the tree above? I will read this file in inicialization of repository and extends it with my other needs..
Thanks a lot guys
Helio.

Re: Custom nodetypes, any simple example?

Posted by Torgeir Veimo <to...@pobox.com>.
On Thu, 2006-03-09 at 14:43 -0300, hsp wrote:
> 
> So, I think the "my:timelife" is mix (?), and the other child
> nodetypes are Date (I don't know who would be the parent for
> "my:timelife"). There are some more needs, but with this example I
> will mind the others.
> Could someone mount a simple xml example with the tree above? 

You can define a mixin nodeType with the my:timeini and my:timeend
values stored as properties. Then you can attach that mixin nodeType to
an existing node of your choice and add those properties. A mixin node
doesn't have any parent nodeType. In CND notation;

<my = 'http://some.org/my/1.0'>
[my:timelife] mixin
- my:timeini (date) mandatory
- my:timeend (date) mandatory


-- 
Torgeir Veimo <to...@pobox.com>