jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vlad_v <numaplictis...@yahoo.com>
Subject Re: node types
Date Tue, 21 Oct 2008 19:40:17 GMT

Hi, Thank you for the ideea

i tried to add a new node type  and i did this

    xmlns:rep="internal" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    <nodeType name="nt:owner" isMixin="false" hasOrderableChildNodes="false"
        <propertyDefinition name="nt:owner" requiredType="String"
autoCreated="false" mandatory="false" 
protected="false" multiple="false"/>

I put the file in the repository/nodetypes  and it is called
custom_nodetypes.xml. It seems to be correct the  sintax because tomcat
doesn't produce any exceptions at startup.
but, when i do this : 

node.addNode(login, "nt:owner");
i get:

javax.jcr.nodetype.ConstraintViolationException: /new_folder/vlad1:
mandatory child node {http://www.jcp.org/jcr/1.0}content does not exist

I thought it is not good to use the namespace "nt"  and i put in 
a new line: owner=http://www.jcp.org/jcr/1.0  but tomcat complains with
Unknown namespace prefix owner.

Thanks a lot,


nt:file does not allow residual properties (ie. arbitrarily named
properties, aka unstructured content) itself, so you could either add
a mixin at runtime that introduces a * property definition (or a
strict "roles" property if you only want that one) or create a new
node type that extends from nt:file and adds the "roles" or *
property. If you want to store a list of strings, a multi-value STRING
property, ie. a String[], is probably exactly what you need.

For more on node types see http://jackrabbit.apache.org/node-types.html


View this message in context: http://www.nabble.com/node-types-tp20093480p20097843.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message