You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Marcel Dullaart <ma...@gmail.com> on 2006/12/04 11:17:40 UTC

Re: Creating NodeType with dynamic, linked properties

Hi all,

This definitely seems to be a good idea for several occasions.
I'd like to re-use this idea for defining locales, and using them to
determine the locale for content items.
But how can I restrict the type of a reference in the cnd file?

Thanks,
Marcel

On 11/16/06, Jukka Zitting <ju...@gmail.com> wrote:
>
> Hi,
>
> On 11/16/06, Stefan Guggisberg <st...@gmail.com> wrote:
> > you could e.g. create a node type myapp:Category that extends from
> > mix:referenceable. now for each category (e.g. book, dvd, etc) you can
> > create a node of type myapp:Category.
> >
> > in your custom node types make your "category" property a REFERENCE
> > property and restrict it to myapp:Category.
> >
> > you can add new categories (nodes of type myapp:Category) at any time.
>
> This is one of my favourite JCR patterns. Not only it gives you nice
> and controlled extensibility, it allows you to easily attach whatever
> information to the category nodes *and* gives you a blazing-fast
> mechanism to list all nodes that link to a given category.
>
> BR,
>
> Jukka Zitting
>