jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torgeir Veimo <torg...@pobox.com>
Subject Re: Nodetypes doubt (newbie).
Date Thu, 09 Mar 2006 22:46:30 GMT
On Thu, 2006-03-09 at 11:01 -0300, hsp wrote:
> I have the following doubt.

> Can I set the properties directly for fileNode, instead have to create another node of
nodetype nt:resource? Like this:
> 		        Node fileNode = parentnode.addNode(file.getName(), "nt:file");
> 		        fileNode.setProperty("jcr:mimeType", mimeType);
> 		        fileNode.setProperty("jcr:encoding", "");
> 		        resNode.setProperty("jcr:data", new FileInputStream(file));
>                         .....;
> What consequences, considerations, about the two kind of implementation?

If you created a new nodeType of your own design you could do that. The
nt:file node however is designed to have the content in a child node,
and will fail validation on save if you do it otherwise.

Torgeir Veimo <torgeir@pobox.com>

View raw message