Using WebDAV with EditLive! for XML

Introduction

Ephox EditLive! for XML supports the WebDAV protocol to enable directory browsing when adding images or hyperlinks to a document. This provides the end users of EditLive! for XML with an interface to easily browse directories on the server. However, through the use of EditLive! for XML's XML configuration users can also be restricted in their access so that only specific WebDAV repositories are available to them.

This document provides information on how to use WebDAV with EditLive! for XML. It assumes that you have a WebDAV enabled server and are able to configure your server to allow WebDAV access to specific directories.

Using WebDAV with Images in EditLive! for XML

When using a WebDAV server with an instance of EditLive! for XML that has been configured accordingly results in users being able to browse the relevant WebDAV repository from within the Insert Object, Insert Image and Insert Hyperlink dialogs in EditLive! for XML. In the case of the Insert Image and Insert Object dialogs EditLive! for XML filters the available files on the WebDAV repository according to their MIME type. The Insert Image dialog will only include files which have the image/jpeg, image/gif or image/png MIME types while the Insert Object dialog will only include files that match the file types specified in the multimedia configuration.

Configuring EditLive! for XML for Use with WebDAV

EditLive! for XML can be easily configured for use with WebDAV via the EditLive! for XML configuration file. The configuration settings for the use of WebDAV with EditLive! for XML can be found within the <webdav> element of the EditLive! for XML configuration file. The <webdav> element contains a listing of WebDAV repositories which have their details specified by the <repository> elements. For more information on these elements please see the EditLive! for XML Configuration Guide.

In order to use WebDAV with EditLive! for XML then the WebDAV property or attribute of your chosen EditLive! for XML API must be set to true. For more information on this property or attribute please consult your EditLive! for XML API.

Basic Configuration Example

The following provides a basic example of how to configure an instance of EditLive! for XML for use with a WebDAV repository. It involves the minimum number of settings to get WebDAV functioning correctly within EditLive! for XML. The server does not implement password protection. For the purposes of this example the WebDAV server which EditLive! for XML is being configured for use with has the following properties:

  • The WebDAV repository has the URL http://www.yourserver.com/UserFiles/WebDAV.

  • The BASE for documents created with EditLive! for XML (i.e. the setting of the BASE property of EditLive! for XML) is http://www.yoursever.com/UserFiles/EditLiveFiles. This means that the location of the WebDAV repository relative to the EditLive! for XML document base is ../WebDAV.

  • The repository should be listed to users as the Images repository.

The XML configuration for EditLive! for XML, in this case, would be:

<editLive> 
  ... 
  <webdav> 
    <repository 
      name="Images" 
      baseDir="http://www.yourserver.com/UserFiles/WebDAV" 
      webDAVBaseURL="../WebDAV" 
    /> 
  </webdav> 
  ...
</editLive>

Setting a Default Browsing Directory

If, you want the end users of EditLive! for XML to view a directory other than the root directory of the WebDAV repository by default then the defaultDir attribute of the <repository> element should be used and assigned the relevant value. Users can still move up the directory tree to the root directory if desired.

Continuing from the example above, if the http://www.yourserver.com/UserFiles/WebDAV directory had a subdirectory images which you wished the users of EditLive! for XML to access by default then the XML configuration for EditLive! for XML would be as follows:

<editLive>
  ...
  <mediaSettings>
    <images>
      <webdav>
        <repository
          name="Images" 
          baseDir="http://www.yourserver.com/UserFiles/WebDAV"
          webDAVBaseURL="../WebDAV"
          defaultDir="images"
        />
      </webdav>
    </images>
  </mediaSettings>
  ...
</editLive>

MIME Type Filtering with WebDAV

The browsing of a WebDAV repository with EditLive! for XML can be restricted according to the MIME of the files within the repository. As the WebDAV functionality within EditLive! for XML is used with images then files with the following MIME types will be displayed:

  • image/jpeg

  • image/png

  • image/bmp

  • image/gif

In order to activate MIME type filtering within EditLive! for XML the EditLive! for XML configuration file must contain the relevant setting. Continuing from the examples above the XML configuration for EditLive! for XML would be as follows:

<editLive>
  ...
  <mediaSettings> 
    <images> 
      <webdav> 
        <repository 
          name="Images" 
          baseDir="http://www.yourserver.com/UserFiles/WebDAV" 
          webDAVBaseURL="../WebDAV" 
          defaultDir="images" 
          useMimeType="true"
        /> 
      </webdav> 
    </images> 
  </mediaSettings> 
  ... 
</editLive>

Note

The default setting for the useMimeType attribute is true.

Password Protected WebDAV Repositories

If your WebDAV repository implements basic authentication then you can configure EditLive! for XML to use the correct username and password information. In order to do this the <realm>element should be used and assigned the relevant values for the realm, username and password for the WebDAV repository concerned. If the username and password specified are incorrect, EditLive! for XML will prompt the user for a user for a username and password when the WebDAV server is accessed.

EditLive! for XML supports the following forms of authentication:

  • Basic

  • Digest

  • NTLM

Continuing from the examples above the realm was www.yourserver.com (an NTLM realm), and if the username was webdav and the corresponding password was example then the XML configuration for EditLive! for XML would be as follows:

<editLive> 
  ...
  <authentication> 
    <realm realm="www.yourserver.com" username="webdav" password="example" /> 
  </authentication> 
  ... 
  <mediaSettings> 
    <images>
      <webdav> 
        <repository 
          name="Images" 
          baseDir="http://www.yourserver.com/UserFiles/WebDAV" 
          webDAVBaseURL="../WebDAV" 
          defaultDir="images" 
          useMimeType="true" 
        /> 
      </webdav> 
    </images> 
  </mediaSettings> 
  ... 
</editLive>

Summary

EditLive! for XML can easily be configured to work with WebDAV repositories which exist on your Web server. The configuration of EditLive! for XML for use with WebDAV affects end users when using the Insert Hyperlink and Insert Image dialogs. In these dialogs the configuration of EditLive! for XML in this manner allows the end users to browse the server for files to link to, in the case of the Insert Hyperlink dialog, and, in the case of the Insert Image dialog, images which may be inserted.

EditLive! for XML can be configured for use with WebDAV through the <webdav> and <repository> XML elements. EditLive! for XML can be configured, through the <realm> XML element, to access WebDAV servers which are password protected or can be left to prompt users for a username and password.

See Also