You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Oleg <ov...@googlemail.com> on 2009/11/27 18:04:31 UTC
How can I extend jcr:content to new properties?
Hello,
I have a custom_nodetypes.xml to register custom node types. It works fine
for all custom nodes, but I can not customize the node jcr:content. I get an
exception:
org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException:
[{some-http-url}file] failed to resolve node type definition
This is the problematic part of the node definition:
<nodeType name="cssns:resource"
isMixin="false"
hasOrderableChildNodes="false"
primaryItemName="jcr:data">
<supertypes>
<supertype>nt:resource</supertype>
</supertypes>
<propertyDefinition name="cssns:size"
requiredType="Long"
autoCreated="true"
mandatory="true"
onParentVersion="COPY"
protected="false"
multiple="false">
<defaultValues>
<defaultValue>-1</defaultValue>
</defaultValues>
</propertyDefinition>
</nodeType>
<nodeType name="cssns:file"
isMixin="false"
hasOrderableChildNodes="false"
primaryItemName="jcr:content">
<supertypes>
<supertype>nt:file</supertype>
<supertype>mix:versionable</supertype>
<supertype>cssns:hierarchyNode</supertype>
</supertypes>
<propertyDefinition name="cssns:documentTitle"
requiredType="String"
autoCreated="false"
mandatory="true"
onParentVersion="COPY"
protected="false"
multiple="false"/>
<childNodeDefinition name="jcr:content"
defaultPrimaryType=""
autoCreated="false"
mandatory="true"
onParentVersion="COPY"
protected="false"
sameNameSiblings="false">
<requiredPrimaryTypes>
<requiredPrimaryType>cssns:resource</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
</nodeType>
If I take out the section <childNodeDefinition .... </childNodeDefinition>
it works, but I want to extend the node jcr:content to a new property
cssns:size. What do I do wrong? Please, help me!
Thanks!
Oleg.
--
View this message in context: http://n4.nabble.com/How-can-I-extend-jcr-content-to-new-properties-tp788810p788810.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: How can I extend jcr:content to new properties?
Posted by Oleg <ov...@googlemail.com>.
Thanks, thanks. It works. I use XML node type definition. No CND files.
Alexander Klimetschek wrote:
>
> On Mon, Nov 30, 2009 at 06:56, Sunil Dhage <su...@coreobjects.com>
> wrote:
>> You can find both cnd and registering cnd in the jackrabbit wiki
>
> Or right here on the main website:
>
> http://jackrabbit.apache.org/node-types.html
> http://jackrabbit.apache.org/node-type-notation.html
>
> Regards,
> Alex
>
> --
> Alexander Klimetschek
> alexander.klimetschek@day.com
>
>
--
View this message in context: http://n4.nabble.com/How-can-I-extend-jcr-content-to-new-properties-tp788810p931220.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: How can I extend jcr:content to new properties?
Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Nov 30, 2009 at 06:56, Sunil Dhage <su...@coreobjects.com> wrote:
> You can find both cnd and registering cnd in the jackrabbit wiki
Or right here on the main website:
http://jackrabbit.apache.org/node-types.html
http://jackrabbit.apache.org/node-type-notation.html
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com
RE: How can I extend jcr:content to new properties?
Posted by Sunil Dhage <su...@coreobjects.com>.
Hi Oleg,
you can extend any node type provide you need to follow the below steps.
First create your.cnd file, cnd refers to compact node definition.
[namespace:yournodetype] > jcr:content
[namespace:yourproperty] (datatype)
..
..
Then register your cnd.
You can find both cnd and registering cnd in the jackrabbit wiki
/Sunil Dhage
________________________________________
From: Oleg [ovaraksin@googlemail.com]
Sent: Saturday, November 28, 2009 3:36 AM
To: users@jackrabbit.apache.org
Subject: Re: How can I extend jcr:content to new properties?
Hi,
I have just found that. The line <supertype>nt:file</supertype> must be
deleted because there is "ambiguous child node definition" (jackrabbit class
EffectiveNodeType, method internalMerge).
- Oleg.
--
View this message in context: http://n4.nabble.com/How-can-I-extend-jcr-content-to-new-properties-tp788810p803928.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
Re: How can I extend jcr:content to new properties?
Posted by Oleg <ov...@googlemail.com>.
Hi,
I have just found that. The line <supertype>nt:file</supertype> must be
deleted because there is "ambiguous child node definition" (jackrabbit class
EffectiveNodeType, method internalMerge).
- Oleg.
--
View this message in context: http://n4.nabble.com/How-can-I-extend-jcr-content-to-new-properties-tp788810p803928.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.