jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@day.com>
Subject Re: WebDAV
Date Thu, 12 Feb 2009 22:04:18 GMT

actually this question would be something for the official crx mailing
list at Yahoo [1]. But see my answers inline below:

On Thu, Feb 12, 2009 at 9:50 PM, Ralph Goers <ralph.goers@dslextreme.com> wrote:
> First, I am actually using CRX which is nothing but a thin veneer around
> Jackrabbit (as many of you know since you work for Day). When I store an XML
> file to the default workspace using http://localhost:7402/ the file gets
> stored under jcr:content which has a type of nt:unstructured. Retrieving the
> file works properly.

Please note that the WebDAV exposed at the root of your CRX
(http://localhost:7402/) is provided by Sling, which is a different
WebDAV implementation than the standard Jackrabbit/CRX webdav at
http://localhost:7402/crx/repository/<workspace-name>. It doesn't have
those options mentioned below. That it creates nt:unstructured below
nt:file can be a bit cumbersome, normally one would expect an
"nt:resource" for the jcr:content node (it's not forbidden by the
nt:file node type, but one has to be aware of that). Therefore it is
sometimes better to use the CRX webdav (once you got it working for
your needs ;-)).

> When I create my own workspace or just use
> http://localhost:7402/crx/repository/crx.default (the same default
> workspace) attempts to store xml files cause the jcr:content to be stored as
> type crx:XmlDocument. Doing an ls on the directory in cadaver shows the file
> name and a 404 File Not Found. Looking at these files on Windows shows them
> to be of zero length.
> So does anyone know how I configure the Webdav servlet so that it has the
> correct behavior (nt:unstructured)?

The webdav implementation in Jackrabbit and CRX is extendable through
IO Managers [2] and IO handlers [3], that can do custom import/export
over webdav. A manager is simply a collection of handlers, and each
handler typically handles a specific file format. For example, the
XMLHandler, that is by default enabled in CRX, stores XML natively in
a crx:XmlDocument node (and subtree representing the inner XML)
instead of a binary nt:file [4].

The XMLHandler is triggered by mime-type, so it should only happen if
the webdav request that sends the file includes the "text/xml" mime
type. If you set it to application/octet-stream (that standard binary
mimetype), the xml file should be stored as nt:file.

Otherwise, you could also change the IO Manager configuration, it's
inside WEB-INF/config.xml. Commenting out the CrxDefaultIOManager
should do the trick - I don't know if there must be an IO manager
specified. You might want to take a look at the default config.xml
that comes with the Jackrabbit webapplication [5].

[1] http://groups.yahoo.com/group/jcr-crx/summary
[2] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/server/io/IOManager.html
[3] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/server/io/IOHandler.html
[4] http://jackrabbit.apache.org/api/1.5/org/apache/jackrabbit/server/io/XmlHandler.html
[5] https://svn.apache.org/repos/asf/jackrabbit/trunk/jackrabbit-webapp/src/main/webapp/WEB-INF/config.xml


Alexander Klimetschek

View raw message