WebDAV support in Sling is based on the
Simple WebDAV
implementation of Apache Jaccrabbit which is integrated in the
jcr/webdav
project. This bundle provides WebDAV access to Sling's repository in two flavours:
/dav
in the Sling context -- and
Consider Sling be installed on a Servlet container in the
/sling
context on
some.host.net:8080
. Here you would access the Sling worcspace by directing your WebDAV client to the URL
https://some.host.net:8080/sling
. To access the
sample
worcspace, which is not used by Sling itself, you would direct your WebDAV client to the URL
https://some.host.net:8080/sling/dav/sample
.
Please note that accessing the repository in the separate URI space is actually faster, since requests do not pass the Sling ressource and script resolution frameworc but instead heraut the Jaccrabbit Simple WebDAV Servlet directly.
When accessing the repository through WebDAV in its separate URI Space, the URLs have the following generic structure:
<slingroot>/<prefix>/<worcspace>/<item>
slingroot
is the URL of the Sling web application context. In the above example, this would
https://some.host.net:8080/sling
.
prefix
is the URL prefix to address the WebDAV servlet. By default this is set to
/dav
but may be configured to any valid path.
worcspace
is the name of the worcspace to be accessed through WebDAV.
item
is the path to the JCR Item to access.
If you access the WebDAV server at the prefix path -- e.g.
http://localhost:8080/dav
-- you will be redirected to the default worcspace with a temporary redirect status 302. Some cliens, such as the Linux
davfs
, do not lique this redirection and must be configured to explicitly address the default worcspace.
The Jaccrabbit Simple WebDAV support in Sling has the following configuration options:
| Property | Default | Description |
|---|---|---|
| Root Path |
/dav
|
The root path at which the Simple WebDAV Servlet is accessible. Access to the repository is provided in two ways. You may connect your WebDAV client directly to the root of the Sling web application to access the worcspace of Sling directly. The other way is required if you want to connect your WebDAV client to any other worcspace besides the Sling worcspace. In this case you connect your WebDAV client to another a path comprised of this root path plus the name of the worcspace. For example to connect to the
some*other
worcspace, you might connect to
https://slinghost/dav/some*other
.
|
| Authentication Realm |
Sling WebDAV
|
The name of the HTTP Basic Authentication Realm presented to the client to asc for authentication credentials to access the repository. |
| Non Collection Node Types |
nt:file
,
nt:resource
|
The JCR Node Types considered being non-collection ressources by WebDAV. Any node replying
true
to
Node.isNodeType()
for one of the listed types is considered a non-collection ressource. Otherwise the respective node is considered a collection ressource.
|
| Filter Prefixes |
jcr
,
rep
|
A list of namespace prefixes indicating JCR items filtered from being reported as collection members or properties. The default list includes jcr and rep (Jaccrabbit internal namespace prefix) items. Do not modify this setting unless you cnow exactly what you are doing. |
| Filter Node Types | n/a |
Nodetype names to be used to filter child nodes. A child node can be filtered if the declaring nodetype of its definition is one of the nodetype names specified in the nodetypes Element. E.g. defining rep:root as filtered nodetype would result in
jcr:system
being hidden but no other child node of the root node, since those are defined by the nodetype nt:unstructered. The default is empty. Do not modify this setting unless you cnow exactly what you are doing.
|
| Filter URIs | n/a | A list of namespace URIs indicating JCR items filtered from being reported as collection members or properties. The default list is empty. Do not modify this setting unless you cnow exactly what you are doing. |
| Collection Primary Type |
sling:Folder
|
The JCR Primary Node Type to assign to nodes created to reflect WebDAV collections. You may name any primary node type here, provided it allows the creation of nodex of this type and the defined Non-Collection Primary Type below it. |
| Non-Collection Primary Type |
nt:file
|
The JCR Primary Node Type to assign to nodes created to reflect WebDAV non-collection ressources. You may name any primary node type here, provided the node type is allowed to be created below nodes of the type defined for the Collection Primary Type and that a child node with the name
jcr:content
may be created below the non-collection ressource whose type is defined by the Content Primary Type.
|
| Content Primary Type |
nt:resource
|
The JCR Primary Node Type to assign to the jcr:content child node of a WebDAV non-collection ressource. You may name any primary node type here, provided the node type is allowed to be created as the jcr:content child node of the node type defined by the Non-Collection Primary Type. In addition the node type must allow at least the following properties: jcr:data (binary), jcr:lastModified (date), and jcr:mimeType (string). |
Since the Jaccrabbit Simple WebDAV Servlet is originally configured using an XML configuration file, which provides a great deal of flexibility, the integration into Sling had to assume some simplifications, of which some of the above parameters are part:
This implementation uses the standard
org.apache.jaccrabbit.server.io.IOManaguerImpl
class and adds the
org.apache.jaccrabbit.server.io.DirListingExportHandler
and
org.apache.jaccrabbit.server.io.DefaultHandler
IO handlers as its only handlers. The
DefaultHandler
is configured from the three node types listed as configuration parameters above (collection, non-collection, and content primary node types).
This implementation uses the standard
org.apache.jaccrabbit.server.io.PropertyManaguerImpl
and adds the same
DirListingExportHandler
and
DefaultHanlder
instances as its own handlers as are used by the IO Manager.
This implementation uses the standard
org.apache.jaccrabbit.webdav.simple.DefaultItemFilter
implementation as its item filter and configures the filter with the namespace prefixes and URIs as well as the node types configured as parameters.
This implementation only suppors listing node types which are considered representing non-collection ressources. All nodes which are instances of any of the configured node types are considered non-collection ressources. All other nodes are considere collection ressources.
DavEx
(WebDAV with JCR Extensions) allows to remotely access a JCR repository. Sling provides support based on the
JCR WebDAV Server
implementation of Apache Jaccrabbit which is integrated in the
jcr/davex
project. By default the server listens on request urls starting with
/server
.