Difference between revisions of "WebDAV"

From BaseX Documentation
Jump to navigation Jump to search
(Initial version of the WebDAV page)
 
m (Text replacement - "8984" to "8080")
 
(73 intermediate revisions by 6 users not shown)
Line 1: Line 1:
BaseX offers access to the databases and documents using the [http://en.wikipedia.org/wiki/Webdav WebDAV] protocol. WebDAV provides convenient means to access and edit XML documents by representing BaseX databases and documents in the form of a file system hierarchy.
+
This page presents one of the [[Web Application]] services. It describes how to use the WebDAV file system interface.
  
==Starting BaseX WebDAV==
+
BaseX offers access to the databases and documents using the [https://en.wikipedia.org/wiki/Webdav WebDAV] protocol. WebDAV provides convenient means to access and edit XML documents by representing BaseX databases and documents in the form of a file system hierarchy.
The WebDAV implementation of BaseX is provided by a module (servlet) which runs in the BaseX HTTP server. Please, check the [[Startup#BaseX HTTP Server|Startup: BaseX HTTP Server]] page for details on how to start the BaseX HTTP Server. The BaseX WebDAV Server can use either the local databases or connect to a remote BaseX Server. Please, check the [[Startup_Options#BaseX_HTTP_Server|startup options of the BaseX HTTP Server]].
+
 
==Accessing BaseX WebDAV==
+
The implementation in BaseX is based on the [http://milton.io Milton library]. Currently, only Basic Authentication is supported.
The BaseX WebDAV Server can be accessed using either with a <code>http://<httphost>:<httpport>/webdav/</code> or <code>webdav://<httphost>:<httpport>/webdav/</code> URL, depending on the used WebDAV client. For example, <code>http://localhost:8984/webdav/</code>.
+
 
==Authorisation==
+
=Usage=
The BaseX WebDAV Server uses the database user credentials in order to perform authentication and authorisation. However, if database user and password are explicitly specified when starting the BaseX HTTP Server using the corresponding [[Startup_Options#BaseX_HTTP_Server|startup options]], then the WebDAV Server will not request user authentication from the client.
+
 
==WebDAV Clients==
+
By default, the BaseX HTTP server makes the WebDAV service accessible at {{Code|http://localhost:8080/webdav/}}. If no default credentials are specified, they will be requested by the client ([[Web Application#User Management|see further]]). It can be accessed by either <code>http:&#47;&#47;<httphost>:<httpport>/webdav/</code> or <code>webdav://<httphost>:<httpport>/webdav/</code>, depending on your WebDAV client.
===Oxygen===
+
 
===Windows Explorer===
+
Please note that the file size of XML documents will be displayed as 0 bytes, as the actual file size can only be determined if the full document is being returned and serialized. This may cause problems with some WebDAV clients (e.g., NetDrive or WebDrive).
===Linux: Konqueror, Dolphin, Nautilus, and Others===
+
 
 +
=Authentication=
 +
 
 +
The WebDAV service uses the database user credentials to perform authentication and authorization. A default user can be defined in the configuration [[Web Application#Authentication|as described here]].
 +
 
 +
=Root Directory=
 +
 
 +
In the WebDAV root directory, all existing databases are listed. As new resources can only be stored inside a database, it is not possible to store files in the root directory. If a file is copied on top level, a new database will be created, which contains this resource.
 +
 
 +
=Resources=
 +
 
 +
==XML Documents==
 +
 
 +
Uploaded files that start with an angle bracket will be stored as XML files. XML entities will be decoded during this process.
 +
 
 +
If a file is downloaded, the characters with the following code points will be encoded as entities:
 +
 
 +
* 160 (non-breaking space)
 +
* 8192–8207, 8232–8239, 8287–8303 (see [https://en.wikipedia.org/wiki/General_Punctuation General Punctuation])
 +
 
 +
==Binary Files==
 +
 
 +
If XML parsing files, or if the first character of the input is no angle bracket, the file will be stored as binary resource.
 +
 
 +
=Locking=
 +
 
 +
The BaseX WebDAV implementation supports locking. It can be utilized with clients which support this feature (e.g. [[oXygen|oXygen Editor]]). [https://tools.ietf.org/html/rfc4918#section-6.2 EXCLUSIVE and SHARED] locks are supported, as well as [https://tools.ietf.org/html/rfc4918#section-7 WRITE] locks.
 +
 
 +
'''Note:''' WebDAV locks are stored in a database called <code>~webdav</code>. If the database is deleted, it will automatically be recreated along with the next lock operations. If a resource remains locked, it can be unlocking by removing the correspondent <code><w:lockinfo></code> entry.
 +
 
 +
=WebDAV Clients=
 +
 
 +
Please check out the following tutorials to get WebDAV running on different operating systems and with oXygen:
 +
 
 +
* [[WebDAV: Windows 7|Windows 7 and up]]
 +
* [[WebDAV: Windows XP|Windows XP]]
 +
* [[WebDAV: Mac OSX|Mac OSX 10.4+]]
 +
* [[WebDAV: GNOME|GNOME and Nautilus]]
 +
* [[WebDAV: KDE|KDE]]
 +
* [[Integrating oXygen|oXygen Editor]]
 +
 
 +
=Changelog=
 +
 
 +
;Version 7.7
 +
* Added: [[#Locking|Locking]]
 +
 
 +
;Version 7.0
 +
* WebDAV API introduced

Latest revision as of 09:29, 3 August 2022

This page presents one of the Web Application services. It describes how to use the WebDAV file system interface.

BaseX offers access to the databases and documents using the WebDAV protocol. WebDAV provides convenient means to access and edit XML documents by representing BaseX databases and documents in the form of a file system hierarchy.

The implementation in BaseX is based on the Milton library. Currently, only Basic Authentication is supported.

Usage[edit]

By default, the BaseX HTTP server makes the WebDAV service accessible at http://localhost:8080/webdav/. If no default credentials are specified, they will be requested by the client (see further). It can be accessed by either http://<httphost>:<httpport>/webdav/ or webdav://<httphost>:<httpport>/webdav/, depending on your WebDAV client.

Please note that the file size of XML documents will be displayed as 0 bytes, as the actual file size can only be determined if the full document is being returned and serialized. This may cause problems with some WebDAV clients (e.g., NetDrive or WebDrive).

Authentication[edit]

The WebDAV service uses the database user credentials to perform authentication and authorization. A default user can be defined in the configuration as described here.

Root Directory[edit]

In the WebDAV root directory, all existing databases are listed. As new resources can only be stored inside a database, it is not possible to store files in the root directory. If a file is copied on top level, a new database will be created, which contains this resource.

Resources[edit]

XML Documents[edit]

Uploaded files that start with an angle bracket will be stored as XML files. XML entities will be decoded during this process.

If a file is downloaded, the characters with the following code points will be encoded as entities:

Binary Files[edit]

If XML parsing files, or if the first character of the input is no angle bracket, the file will be stored as binary resource.

Locking[edit]

The BaseX WebDAV implementation supports locking. It can be utilized with clients which support this feature (e.g. oXygen Editor). EXCLUSIVE and SHARED locks are supported, as well as WRITE locks.

Note: WebDAV locks are stored in a database called ~webdav. If the database is deleted, it will automatically be recreated along with the next lock operations. If a resource remains locked, it can be unlocking by removing the correspondent <w:lockinfo> entry.

WebDAV Clients[edit]

Please check out the following tutorials to get WebDAV running on different operating systems and with oXygen:

Changelog[edit]

Version 7.7
Version 7.0
  • WebDAV API introduced