You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Jeremy Norris <jn...@pattern73.com> on 2010/02/06 06:20:41 UTC

CND Definition Question:

What is wrong with the following CND definition?  I am trying to
enforce that a node of type Foo contains a node of type Bar.

---

<nt  = 'http://www.jcp.org/jcr/nt/1.0'>
<mix = 'http://www.jcp.org/jcr/mix/1.0'>
<ns = 'uri:ns/v1'>

[ns:Bar] > nt:base
    mix:created,
    mix:lastModified
  - ns:attr1 (string)
  - ns:attr2 (string)

[ns:Foo] > nt:base
  + ns:bar (ns:Bar)

---

When I try this, I get the following error:

org.apache.jackrabbit.commons.cnd.ParseException: Unkown property type
'ns:Bar' specified.

(on the last line of the definition).  I'm using jackrabbit 2.0.0 and
importing definitions with
org.apache.jackrabbit.commons.cnd.CndImporter

Thanks for your help.

Re: CND Definition Question:

Posted by Jeremy Norris <jn...@pattern73.com>.
I found the source of the problem by stepping through the parser.  In
my actual definition, my node name had a dash (-) in it that was not
quoted (which then started an attribute definition).

Thanks,
-Jeremy

On Sat, Feb 6, 2010 at 9:39 AM, Jeremy Norris <jn...@pattern73.com> wrote:
> That's interesting, I will investigate that.  I am new to jackrabbit
> so I am not sure if this is a definition problem or a loading/import
> problem.  I am using org.apache.jackrabbit.commons.cnd.CndImporter
> which I thought would handle whatever needed to be done to import the
> types into the repository.
>
> If this is a loading problem, then do I have to import and load each
> new type individually?  It seems very convenient and reasonable to
> reference several new types in a single .cnd file (that have
> references to new types within the definition like my example).  In
> fact, the jackrabbit source includes several test .cnd files with
> multiple type definitions within it.
>
> Thanks for you thoughts,
>
> -Jeremy
>
> On Sat, Feb 6, 2010 at 9:15 AM, ChadDavis <ch...@gmail.com> wrote:
>> You should try to determine if your node types are actually loaded.
>>
>> On Fri, Feb 5, 2010 at 10:20 PM, Jeremy Norris <jn...@pattern73.com> wrote:
>>> What is wrong with the following CND definition?  I am trying to
>>> enforce that a node of type Foo contains a node of type Bar.
>>>
>>> ---
>>>
>>> <nt  = 'http://www.jcp.org/jcr/nt/1.0'>
>>> <mix = 'http://www.jcp.org/jcr/mix/1.0'>
>>> <ns = 'uri:ns/v1'>
>>>
>>> [ns:Bar] > nt:base
>>>     mix:created,
>>>     mix:lastModified
>>>   - ns:attr1 (string)
>>>   - ns:attr2 (string)
>>>
>>> [ns:Foo] > nt:base
>>>   + ns:bar (ns:Bar)
>>>
>>> ---
>>>
>>> When I try this, I get the following error:
>>>
>>> org.apache.jackrabbit.commons.cnd.ParseException: Unkown property type
>>> 'ns:Bar' specified.
>>>
>>> (on the last line of the definition).  I'm using jackrabbit 2.0.0 and
>>> importing definitions with
>>> org.apache.jackrabbit.commons.cnd.CndImporter
>>>
>>> Thanks for your help.
>>>
>>
>

Re: CND Definition Question:

Posted by Jeremy Norris <jn...@pattern73.com>.
That's interesting, I will investigate that.  I am new to jackrabbit
so I am not sure if this is a definition problem or a loading/import
problem.  I am using org.apache.jackrabbit.commons.cnd.CndImporter
which I thought would handle whatever needed to be done to import the
types into the repository.

If this is a loading problem, then do I have to import and load each
new type individually?  It seems very convenient and reasonable to
reference several new types in a single .cnd file (that have
references to new types within the definition like my example).  In
fact, the jackrabbit source includes several test .cnd files with
multiple type definitions within it.

Thanks for you thoughts,

-Jeremy

On Sat, Feb 6, 2010 at 9:15 AM, ChadDavis <ch...@gmail.com> wrote:
> You should try to determine if your node types are actually loaded.
>
> On Fri, Feb 5, 2010 at 10:20 PM, Jeremy Norris <jn...@pattern73.com> wrote:
>> What is wrong with the following CND definition?  I am trying to
>> enforce that a node of type Foo contains a node of type Bar.
>>
>> ---
>>
>> <nt  = 'http://www.jcp.org/jcr/nt/1.0'>
>> <mix = 'http://www.jcp.org/jcr/mix/1.0'>
>> <ns = 'uri:ns/v1'>
>>
>> [ns:Bar] > nt:base
>>     mix:created,
>>     mix:lastModified
>>   - ns:attr1 (string)
>>   - ns:attr2 (string)
>>
>> [ns:Foo] > nt:base
>>   + ns:bar (ns:Bar)
>>
>> ---
>>
>> When I try this, I get the following error:
>>
>> org.apache.jackrabbit.commons.cnd.ParseException: Unkown property type
>> 'ns:Bar' specified.
>>
>> (on the last line of the definition).  I'm using jackrabbit 2.0.0 and
>> importing definitions with
>> org.apache.jackrabbit.commons.cnd.CndImporter
>>
>> Thanks for your help.
>>
>

Re: CND Definition Question:

Posted by ChadDavis <ch...@gmail.com>.
You should try to determine if your node types are actually loaded.

On Fri, Feb 5, 2010 at 10:20 PM, Jeremy Norris <jn...@pattern73.com> wrote:
> What is wrong with the following CND definition?  I am trying to
> enforce that a node of type Foo contains a node of type Bar.
>
> ---
>
> <nt  = 'http://www.jcp.org/jcr/nt/1.0'>
> <mix = 'http://www.jcp.org/jcr/mix/1.0'>
> <ns = 'uri:ns/v1'>
>
> [ns:Bar] > nt:base
>     mix:created,
>     mix:lastModified
>   - ns:attr1 (string)
>   - ns:attr2 (string)
>
> [ns:Foo] > nt:base
>   + ns:bar (ns:Bar)
>
> ---
>
> When I try this, I get the following error:
>
> org.apache.jackrabbit.commons.cnd.ParseException: Unkown property type
> 'ns:Bar' specified.
>
> (on the last line of the definition).  I'm using jackrabbit 2.0.0 and
> importing definitions with
> org.apache.jackrabbit.commons.cnd.CndImporter
>
> Thanks for your help.
>