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/04/20 17:05:13 UTC

About child Nodes

In the custom_nodetype.xml, I defined a node type like this:
	<nodeType name="esc:categ" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
		<supertypes>
			<supertype>nt:folder</supertype>
			<supertype>mix:referenceable</supertype>
		</supertypes>
        <childNodeDefinition name="*" defaultPrimaryType="esc:categ" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" sameNameSiblings="false">
            <requiredPrimaryTypes>
                <requiredPrimaryType>esc:categ</requiredPrimaryType>
            </requiredPrimaryTypes>
        </childNodeDefinition>
		<propertyDefinition name="prop:descCateg" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" multiple="false"/>		
		<propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="true" multiple="true"/>
	</nodeType>

So, in my mind, the node of type esc:categ will only permit child nodes of type esc:categ, but I can create whatever kind of type node under a node of type esc:categ. How to restrict this rule?
Another doubt, when I try to define the property prop:descCateg, in the creation of a node of type esc:categ, I got an error:
javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.esc.org/prop/1.0}descCateg
What could it be?
Hope get some help, thanks
Helio.

Re: About child Nodes

Posted by Tobias Bocanegra <to...@day.com>.
your 'esc:categ' is defined as mixin nodetype. do you mix-it in to
something? or do you use it as a primary nodetype?

furthermore, the nt:folder supertype already defined a childnode
definition for 'nt:hierarchyNode'. so you at least can add those.

how do you create your property?

regards, toby

On 4/20/06, hsp <pi...@ibest.com.br> wrote:
> In the custom_nodetype.xml, I defined a node type like this:
>         <nodeType name="esc:categ" isMixin="true" hasOrderableChildNodes="false" primaryItemName="">
>                 <supertypes>
>                         <supertype>nt:folder</supertype>
>                         <supertype>mix:referenceable</supertype>
>                 </supertypes>
>         <childNodeDefinition name="*" defaultPrimaryType="esc:categ" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" sameNameSiblings="false">
>             <requiredPrimaryTypes>
>                 <requiredPrimaryType>esc:categ</requiredPrimaryType>
>             </requiredPrimaryTypes>
>         </childNodeDefinition>
>                 <propertyDefinition name="prop:descCateg" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="false" multiple="false"/>
>                 <propertyDefinition name="*" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="VERSION" protected="true" multiple="true"/>
>         </nodeType>
>
> So, in my mind, the node of type esc:categ will only permit child nodes of type esc:categ, but I can create whatever kind of type node under a node of type esc:categ. How to restrict this rule?
> Another doubt, when I try to define the property prop:descCateg, in the creation of a node of type esc:categ, I got an error:
> javax.jcr.nodetype.ConstraintViolationException: no matching property definition found for {http://www.esc.org/prop/1.0}descCateg
> What could it be?
> Hope get some help, thanks
> Helio.
>


--
-----------------------------------------< tobias.bocanegra@day.com >---
Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel
T +41 61 226 98 98, F +41 61 226 98 97
-----------------------------------------------< http://www.day.com >---