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 2007/01/09 10:58:53 UTC

References in CND notation

Hi all,

I have defined some custom node types that contain references to other nodes.
I'd like to restrict the node type that the reference refers to, is
that possible using CND notation?

Following is a snippet of my CND file:

// Describes the category a content items belongs to.
[my:category]
> nt:base, mix:referenceable
- my:name

// The actual content item
[my:content]
>
- nt:base
- jcr:content
- my:category (reference) multiple

Thanks in advance,
Marcel

Re: References in CND notation

Posted by Marcel Dullaart <ma...@gmail.com>.
Yes this definitely helps, thank you very much.
I just found it in the JCR spec (6.7.16, page 139), I should have read
it before posting.

I'll will also take your recommendation about capitalization into account!

Grtz,
Marcel Dullaart

On 1/9/07, Shaun Barriball <sb...@yahoo.co.uk> wrote:
> Hi Marcel,
> You can achieve this using your model with:
>
> - my:category (reference) multiple
> < 'my:category'
>
> FYI We find it useful to make your type names init capitals to differentiate
> from properties as you can see in your example the property and type can be
> a little confusing. The following reads better.
>
> - my:category (reference) multiple
> < 'my:Category'
>
> Hope this helps,
> Shaun.
>
> -----Original Message-----
> From: Marcel Dullaart [mailto:marcel.dullaart@gmail.com]
> Sent: 09 January 2007 09:59
> To: users@jackrabbit.apache.org
> Subject: References in CND notation
>
> Hi all,
>
> I have defined some custom node types that contain references to other
> nodes.
> I'd like to restrict the node type that the reference refers to, is that
> possible using CND notation?
>
> Following is a snippet of my CND file:
>
> // Describes the category a content items belongs to.
> [my:category]
> > nt:base, mix:referenceable
> - my:name
>
> // The actual content item
> [my:content]
> >
> - nt:base
> - jcr:content
> - my:category (reference) multiple
>
> Thanks in advance,
> Marcel
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>

RE: References in CND notation

Posted by Shaun Barriball <sb...@yahoo.co.uk>.
Hi Marcel,
You can achieve this using your model with:

- my:category (reference) multiple
< 'my:category'

FYI We find it useful to make your type names init capitals to differentiate
from properties as you can see in your example the property and type can be
a little confusing. The following reads better.

- my:category (reference) multiple
< 'my:Category'

Hope this helps,
Shaun.

-----Original Message-----
From: Marcel Dullaart [mailto:marcel.dullaart@gmail.com] 
Sent: 09 January 2007 09:59
To: users@jackrabbit.apache.org
Subject: References in CND notation

Hi all,

I have defined some custom node types that contain references to other
nodes.
I'd like to restrict the node type that the reference refers to, is that
possible using CND notation?

Following is a snippet of my CND file:

// Describes the category a content items belongs to.
[my:category]
> nt:base, mix:referenceable
- my:name

// The actual content item
[my:content]
>
- nt:base
- jcr:content
- my:category (reference) multiple

Thanks in advance,
Marcel

Send instant messages to your online friends http://uk.messenger.yahoo.com