jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Node reference URL/file path in WebDav
Date Tue, 12 Feb 2013 18:51:32 GMT
On 12.02.2013, at 16:40, katsu <kt@haessler.com> wrote:

> I have the following problem. I am accessing jackrabbit repository via
> Webdav. Now I would like to add a file node which the content (data) should
> point to a locally saved file path/URL. E.g. 
> Node fileNode = parentnode.addNode(abc.jpg, "nt:file");
> Node resNode = fileNode.addNode("jcr:content", "nt:resource");		
> resNode.setProperty("jcr:mimeType", mimeType);
> resNode.setProperty("jcr:encoding", "");
> resNode.setProperty("jcr:data", reference to a URL/File Path);	
> And that when I access via Webdav and click on “abc.jpg” I will be
> redirected to the actual path of abc.jpg (e.g. http://image.com/abc.jpg).

You might be able to write a custom IOHandler [0]. See also [1].

Note that you don't want to put a string in jcr:data of a nt:resource, as it's defined to
be binary. I suggest to use a custom node type my:linkedResource (instead of nt:resource)
or even my:linkedFile (instead of nt:file) and use a property like "url" inside jcr:content.

[0] http://jackrabbit.apache.org/api/2.0/org/apache/jackrabbit/server/io/IOHandler.html
[1] http://markmail.org/message/rg4im42n3h53lt7i
[2] http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#

View raw message