Jesper's Blog

Publishing content to ASP.NET web-sites using Windows Live Writer

by Jesper 31. August 2010 02:36

Just released the all new Atom Publishing Protocol server library for ASP.NET.
Here's the background story:

Windows Live Writer is a wonderful application for writing blog posts.

image
It provides a much nicer editing experience than web-based HTML editors, and it is especially good at handling inserted images.
I have often wondered if there was some way to use WLW to edit news articles on our various web-sites (different home grown ASP.NET based systems) and/or use it for more general CMS purposes such as editing knowledge base articles and other web-pages.
Googling for ways to use WLW with ASP.NET did provide a few hints, but I couldn't find any ready-to-use components or complete code samples for this. So this weekend I set out to figure it out.

WLW supports a number of different "blog types":

image

However only one of these is based on RFC standards - the "Atom Publishing Protocol" - a.k.a. "AtomPub".
I am very much in favor of open standards, so I quickly decided that this was the way to go.

Chris Sells suggested creating an AtomPub server using WCF Data Services. However I felt that I needed something more flexible and "lightweight" - not tied to a specific database etc.

Our various web-sites have very different structures, use different background database layouts, are in different stages of development, etc. (but at least most of it is ASP.NET by now).
To make a "drop-in" AtomPub component that would work with all of this, it would have be to very flexible, especially in regards to data storage.
So I decided to make a library which handles all the AtomPub communications stuff (talking to WLW), but leaves the data storage and retrieval details up to each web-site using the library. Basically each web-site will have its own .NET classes which inherit from classes in this library and override methods to store/retrieve data.

Because the AtomPub protocol uses HTTP "PUT" and "DELETE" methods (to update and delete resources) and these methods by default are not handled by standard .aspx pages or .ashx handlers, it made more sense to implement the library as a custom handler (based on IHttpHandler) registered in the site's web.config file.
The PUT/DELETE methods also turned out to conflict with WebDAV - more details about this on the library home page (see link at top).

Putting everything together took a few days, but following the RFC documents, implementing the actual protocol was pretty straight forward. I used the standard .NET XML library and some simple string manipulation to parse and format the Atom XML messages, and the standard ASP.NET libraries to handle Atom related HTTP request and response headers.

The library works great with WLW and we are certainly going to continue implementing it on our various web-sites, making publishing news and other content easier and nicer going forward.

I am releasing this library to the public as freeware (see link at top), hoping that other ASP.NET developers might find it useful as well.

Tags:

Software development | .NET

Perfect rainbow

by Jesper 24. August 2010 19:32

After a dark, stormy, and rainy afternoon, the sun finally broke through to create a perfect rainbow.
View from my office:regnbue
Shot with Canon EOS 7D / Canon EFS 10-22mm (at 10mm)

Tags:

Photography

First photography exhibition

by Jesper 13. August 2010 00:54

Photos (including 3 of mine) from photography class that I attended in the spring are now exhibited at local library (Frederikshavn Bibliotek) until September 14th.

img2img3

img4img5

Tags:

Photography

Photographing paintings

by Jesper 12. August 2010 23:47

My wonderful neighbor, Kirsten Brøndum asked me to photograph some of her paintings for an art gallery submission and for her future web-site/blog. 
A great opportunity to try something new (for me) in photography.
Thanks for the challenge!

It was harder than I expected to get the light right - tried some different flash setups, but ended up using natural light only.
Once I got home and started processing the shots, it turned out that two other challenges were  perspective and barrel/pincushion distortion - not much - but those straight picture frames need to be really really straight...
Good thing I still have Paint Shop Pro 9 - it has a great perspective correction feature where you can just mark each corner of a square (like a picture frame), and it straightens it right up.
I am trying to move to Photoshop CS5, but I just couldn't find any function as easy to use for this job.

The first painting below is actually a portrait my collie"Tricky": 

kirsten

Tags:

Photography

Visit by a common kestrel (tårnfalk)

by Jesper 29. July 2010 20:54

This afternoon this beautiful bird of prey rested on a soccer goal post right next to my office. Luckily the camera was not far away:

IMG_3293b
Shot with Canon EOS 7D / Canon EF400mm f/5.6L USM

Tags:

Photography

Katie Melua in Odense

by Jesper 2. July 2010 13:29
Went to an outdoor concert with Katie Melua in Odense last night.
Wonderful music and weather. Thanks for a great show Katie.

katie

Tags:

Music

Best of PDC09 Copenhagen – Scott Guthrie

by Jesper 3. December 2009 22:51

Attended a one day conference in Copenhagen today.
Great presentations of VS2010, .NET 4.0, MVC 2.0 and Silverlight 4 by Scott Guthrie

Wecome by Ole Kjeldsen Scott Guthrie

 Lunch Audience

Tags:

Conferences | .NET

TechEd Europe 2009 – Berlin

by Jesper 14. November 2009 12:19

Attended TechEd Europe in Berlin.
Good conference – but a bit thin on developer stuff compared to earlier years (in Barcelona).
Next year I think I might go to the PDC in the USA instead – too bad there isn’t a PDC Europe.

PB100019

PB090004

PB090006

Tags:

Conferences

In Berlin – 20 years since the wall fell

by Jesper 10. November 2009 12:01

I’m in Berlin (at Microsoft’s TechEd conference) and joined the “mauerfall” party monday night at the Brandenburg Gate.
Although I got a nasty cold from the rain, this was an exciting experience and I’m very happy to have been part of it:

PB090012

 PB090015

Tags:

Travel

JAOO 2009

by Jesper 8. October 2009 19:30

Back from my first time at the JAOO conference in Århus (Denmark).

Great conference – a bit heavy on Java for a .NET developer like me, but otherwise a great mix of different content.
And all executed very professionally.

Thanks to Trifork and everybody else for a great time and a lot of new inspiration.

Tags:

Conferences

About the author

Jesper G. Høy - Professional software developer & amateur photographer. Lives in Frederikshavn, Denmark. Founder and director of JH Software

Recent posts

Recent comments

Comment RSS

At work

Visual Studio 2010

At play

My Camera

License