jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco Carriedo Scher <fcarrie...@gmail.com>
Subject Re: Creating nt:file under nt:folder exception
Date Wed, 27 Jul 2011 12:01:52 GMT
Thank you very much Stefan, i think i will check more in depth the node
types because i assumed just for the word "folder" in "AuthorizableFolder"
that it could be assignable... I checked yesterday more in depth the node
types:

http://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.cnd

Now i can create folder and file structures and i am working now on
AccessControl.

Thanks again!

2011/7/22 Stefan Guggisberg <stefan.guggisberg@gmail.com>

> On Fri, Jul 22, 2011 at 2:39 PM, Francisco Carriedo Scher
> <fcarriedos@gmail.com> wrote:
> > Hi there,
> >
> > i am trying to add a child node to a nt:folder node
> (rep:AuthorizableFolder
> > node actually, but the same problem arises with other node types). In the
>
> rep:AuthorizableFolder is *not* derived from nt:folder...
>
> > lines below the folder node appears in the path as
> > **USUARIO-1311259687502**.
> >
> > Saw your examples and some similar more, but the following line:
> >
> >            **Node fileNode = folderNode.addNode(file.getName(),
> > "nt:file");**
> >
> > throws the following exception:
> >
> > **Exception in thread "main"
> > javax.jcr.nodetype.ConstraintViolationException: No child node definition
> > for lebAudio.mp3 found in node
> > /rep:security/rep:authorizables/rep:users/USUARIO-1311259687502**
> >
> > Despite of having read some docu about node types (and understanding that
> > nt:file is allowed as nt:folder child, and both are built-in types in
> > Jackrabbit, so nothing special should be done) i do not understand what
> is
> > wrong. Any idea?
>
> you're trying to add a nt:file child node to a rep:AuthorizableFolder node.
>
> rep:AuthorizableFolder is declared as follows:
>
> [rep:AuthorizableFolder] > nt:base, mix:referenceable
>  + * (rep:Authorizable) = rep:User protected version
>  + * (rep:AuthorizableFolder) = rep:AuthorizableFolder protected version
>
> as you can see it doesn't allow nt:file child nodes.
>
> cheers
> stefan
>
> >
> > Thanks in advance, have a nice day!
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message