Managing Domino File Resources Using WebDAV

Jake Howlett, 3 October 2006

Category: Miscellaneous; Keywords: WebDAV Resource Explorer

Lotus Domino provides us a convenient way of centrally storing all the files that make up a website - the NSF file. For most websites this is great. For a website where you need to include lots of files it can become a pain. 

Problem

When using methods like this folder structure is needed it becomes a nightmare. With the prevalance of JavaScript Libraries about at the moment this problem is now come to the fore. Ideally we'd be able to store the many files and folders that make a library in the Domino HTML folder of the server. Realistically this isn't always possible and we need to add all the files to the database design. 

In the past I've found myself importing dozens of files in the NSF and then having to manually rename them all to provide a structured hierarchy. Time-consuming and boring. 

Another problem of adding all the files from a library to is keeping them up to date. When a new version of a library is released, unless you know which files have changed, you'll need to go through the whole process again.

Solution

Using WebDAV we can eliminate all this renaming of resource elements and simple drag-drop copy folders full of files in to our Domino databases.

Assumptions

You're running a Domino server on Windows and have access to setup new DNS entries. You're using Windows XP or other suitable WebDAV client.

Setup

First thing to do is open the server's Address Book. Find your development server's own document and open it up. You need to make sure that Internet Site documents are enabled. As below:

 

We're going to create a new Internet Site document just for use with WebDAV. I'm assuming you're using session-based authentication on your server as is, which WebDAV does not work with. The easiest way to interact in a non-session-based way with the same server is to create a separate website doc that handles a distinct subdomain, such as webdav.dev.company.com or whatever.

So, go to the Configuration\Web\Internet Sites view and create a new one, like below:

 

Notice the subdomain, which we'll setup in our DNS later. Now go to the Configuration tab and make sure WebDAV is enabled down at the bottom, as below:

 

Then, on the Domino Web Engine tab make sure that session-based authentication is disabled:

At this point you'll probably want to restart (refresh?) the HTTP task, if not the whole server. All we need to do now is setup the DNS. How you do this depends on your environment. I'm in charge of my own little LAN and so can do it in one of two ways. The preffered option is to logon to my DNS server and add a new A Host record. If you work in a corporate environment you might need to get your sysadmins to do this. 

The easiest way to add a new DNS entry for your Windows PC is to add a line to the text file found at Windows\System32\drivers\etc\hosts. Open this file in a text editor and add a line in the format: IP Address space FQDN e.g. 192.168.0.10 webdav.rockalldesign.com.

 

Open a browser and try the address. It should take you to the Domino server. Try and access a secured database and you should see an old-fashioned login prompt appear. If so, all is well. If not, start over.

Using WebDAV

WebDAV is supported by a variety of clients. For now we're only interested in using Windows Explorer to transfer folders and files in to our Domino databases.

 

First thi ng to do is allow access to the database we want to work with. Open the A CL's advanced tab and make sure the admin server is correct and that max internet access is set to at least Designer:

 

Optionally we can enable design.document locking on this database. Investigate.

Now open Windows Explorer and we'll connect to the database. From the Tools menu select Map Network Drive. From the dialog that appears, press the link to "Sign up for online storage":  

 

You should get to a screen where you can choose the option below:

 

You  will then be asked for the address of the web site, as below:

 

Enter the path in the format:

http://domain.company.com/path/to/db.nsf$files 

Note that I've used the subdomain we setup for WebDAV and non-session-based authentictation. Pressing next will prompt you to login. Use the credentials of a user with DEsigner+ access to the database you're connecting to.

If all works ok you'll be asked to name this new folder and if you want to open it. Both choices are down to you.

Open Windows Explorer again and go to My Network Places. You should see a folder with the name you chose above.

In my case it's a database called yui.nsf. YUI being the Yahoo! User Interface Library. This JavaScript toolkit comprises dozens of files contained within a strict folder structure. Using WebDAV we can import all these files in to Designer and keep the directory hierarchy. To do so, having downloaded the YUI Zip file and extracted to a folder called "yui", simply drag the folder to your new network place folder. Once copying is complete you should be able to open the folder and see all the files, as below:

 

 

Now for the really magic part. Open the database in Domino Designer and go to the File Resources section. You should see all the files correctly imported, as below:

 

And there you have it.

Still needs adding