The Hoju Saram

Tuesday, June 26, 2007

C# Webdav server with SQL Backend Source Code

kick it on

The C# visual studio 2005 source code for this project is here

I finally got around to getting all of the source code for the webdav server I developed in C# with a SQL backend, I have talked a bit about this previously , but only now have had the time to but it all together so others can download and use/update the code.

The main reason I wrote this code was to provide a "network share" interface to some of my .net applications. I thought it would be very useful to have a framework in place where I could trigger some form of event when someone saved a word file or updated a speadsheet. Because all of the files are stored in a database under the control of the .net application creating this sort of thing is relatively trivial. I have used this to automatically process excel data into a database when someone saves a file to a particular folder for example. (You could also do this via e-mail using this, but that is a different idea). You could also use this to provide per-user content for a single file.

This server is purely for use with Windows Explorer and Microsoft office, so I have not implemented alot of the webdav stuff that isn't implemented by these products. ( this includes webdav-versioning , proppatch etc ), and I can't garauntee it will work with any other webdav clients. Basically this server implementation provides the minimal functionality required to allow MS office and Windows explorer to work.

I have implemented this project to provide 2 interfaces to the virtual filesystem ( provided by an sql database) . A standard web-front end and also the webdav interface. This means that if you connect to the server via a standard web browser you can view the virtual filesystem via a standard web page.

But if connect to the server via a webdav client connection then you get the webdav experience. Which allows you to create , edit, delete , copy , move , rename lock and unlock files and create, rename and delete folders.

There are a number of ways to get a connection to a webdav server as a network share. These include adding a "network place" from "my network places". The easiest way to get connected via webdav is to open the root url url for the application in IE and tick the "Open as web folder" option.

To setup the server you need to do the following steps and also I recommend visiting for lots of helps on configuring webdav for .net

  1. Download the code and open in vs 2005 ( link at top of this post)
  2. Create a new blank database on your sql server
  3. run the create.sql code from the database project against the new database to create the required tables, stored procs and data to support the virtual filesystem
  4. Edit the web.config of the web application project (hojuwebdisk.web) and adjust the database connection string of the "webdav" connection to suit your environment.

As this is a webdav server you will also need to adjust the IIS setting for the website so that it knows how to handles the additional HTTP methods that webdav supports (LOCK, UNLOCK,PROPFIND,MKCOL etc ). Basically because we want .net to intercept all the calls (because we are redirecting all queries to our database not the filesystem) we need to adjust the application extension mapping so all extensions on all VERBs map to the asp IIS handler.

To do this you need to open the application properties of your website from the IIS console and then click the configure button. You then need to remove all of the application extensions and then create a new one for all extensions (.*) for all verbs that executes the .net isapi handler.

A good article explaining the ins-and-outs of this is available here

Once you have completed this setup you should be able to see the webdav server through a webdav connection, and therefore be able to add files and away you go..

I have to give credit to another project for helping me out with this one. The database and database interface stuff was all me, but a lot of the webdav implementation code I got from the webdav server project on sourceforge . If you are looking at developing your own webdav server or extending this code I totally recommend you check out that project. There project uses alot of events and delegates, where as I went with a single interface handler to simplify the code.

If you need any help, or want to add feedback then please do so. Microsoft office and windows have a number of wonderful webdav quirks, which you may need to get around depending on your environment and setup. A good place to start for a list of these is here

So good luck..

Labels: , ,

Friday, June 22, 2007

Looks like there is two new iphone models

If only I had found this picture for 1st April.

Picture for Taku

This one is for Taku.. Near the end of episode 14 of heroes is a little bit of super nerd work.

The number plate on hiro's dads car reads NCC-1701. This is in fact the id number for the original starship enterprise in star trek.

George Takei, who played Sulu on the original Star Trek also plays Hiro's father, Kaito.
Also I think Kaito is definitely *******. Ooh you haven't watched episode 23 yet so I can't talk about that.

Thursday, June 14, 2007

Holden Captiva LX diesel 7 seater

I have been looking around for a new car recently... My wife and I seemed to have agreed on a Holden Captiva LX diesel 7 seater. It just annoys me that holden don't offer a dvd pack in their accessories list.. This is supposed to be a family transporter after all.

You can spec out your own lx here


too busy...

The end of financial year is killing me.. I have so much work to do for my own business and at work I can't find time to blog anything.

Hopefully things will ease up later in the month and I can get back to updating...

Friday, June 01, 2007

More on Domino -> SharePoint migration tool

I am currently writing a C# .net windows form application to migrate IBM domino (notes) data to MS Sharepoint. This is for document libraries only, as sharepoint doesn’t do forms like notes does.(required InfoPath and a whole heap of fiddling)

So basically this is a tool that allows me to do the following:

  • Select a domino document library
  • Select a sharepoint document list
  • Choose fields in the documents in the Notes database and pair them to meta-data fields in the Sharepoint List
  • Pull the rich-text body( including embedded images and attachments ) out of notes and convert it to a word document.
  • Translate the Notes Fields -> Sharepoint fields
  • Save the word document and its meta data to the Sharepoint list.

By automating this process it means that I can simply point the tool at each domino document library database , then map its fields to a sharepoint list and press a button to migrate all of the data. This will give me one word document in the sharepoint list for each notes document in the document library.

The underlying functionality on the domino side is the agent I have talked about early I use this to produce the xml/binary and html that is used by the .net app to gather and translate the domino data. On the sharepoint side I am using a mix of SOAP and FrontPage RPC calls to the sharepoint server to get the List schemas and then place the documents and meta data into the Lists.

I should have some nice screenshots sometime next week of it all in action


Surface computing coffee table

Well I am pretty sure this is an attempted re-hash of an idea I saw about 2 years ago, but even so it is still very cool. A finger driven coffee table computer allows you to send and manipulate data between devices that are resting on it. Although the product itself may have a short and not so useful lifespan. I do think the ease-of-use visualisation that this device has is worth a lot. One of the problems with software development is when you have to communicate technical ideas and business processes with a group of non-technical customers. The ability to build models of data or business processes and then have a multiple customers at once be able to see, reach out, touch and manipulate them would be very helpful indeed.

And the trekkies have got to love it.

Arstechnica has some more in-depth info