MetaWeblog API, Windows Live Writer - Adding Categories

I have just been working on my own custom blog library and as a base I have gone with the MetaWeblog API.  Everything was going great, until I got to the part where I wanted to add custom categories to post and more specifically add to my category list, so I can attach relevant categories to each post at the same time as having those categories available to me for future posts.

So going back a little I simply created my library using the MetaWeblog API and ran Windows Live Writer.  You go through the steps and select the MetaWeblog as the provider type and input the location to your HTTP Handler.  OK so far I am adding, getting and editing my posts.  UNTIL.  At the bottom of the windows live writer interface is the Set Categories box.  When you select it, it will/should call the metaWeblog.getCategories .  So it will then populate its options with your categories so that you can select the ones which are relevant to your post.  One thing I noticed when switching between my custom blog and my asp.net blog, was that in the asp.net blog in the categories select control there was an option to add a category, which in my custom BLOG, was simply not visible. 

This was really start to bake my head.  When you view the contract for the asp.net MetaBlog Handler you do not see any method which exposes a setter for Categories.  i.e.

The following methods are supported:


Where and how the hell does Windows Liver Writer when using the asp.net blog, allow me to add a category.  Well here it goes.  If you look at your settings for the asp.net blog inside Windows Live Writer you see that it says Community Server, sound so Community Server must use MetaWeblogAPI.  But this does not explain the difference in functionality.  SO what I did was, I edit the settings for my custom blog, which still uses the MetaWeblogAPI, and instead of choosing MetaWeblogAPI, which you would think, I selected Community Server.  It configured and completed.  I went to the category select tool and HEY PRESTO there was the option to add a category.

So basically with Community Server selected as the provider type, Windows Live Writer allows you to add categories which it, the program, stores locally.  It retrieves your Category list from the data store and, well kind of caches it, it then appends to this cached list.  Your custom categories thought which you have added do not persist.  Only those in your data store will be available next time you open Live Writer. So this leaves me with a thought:

"Instead of creating an interface on the web to add categories, create a plugin for Live Writer which will communicate with my data store so that, when a category is added using the interface which is already there, I can subscribe to the event and add the new category to my data store. This way when I reload Windows Live Writer, my new categories will be available again if I need to use them again."

I am now looking into the API for Windows Live Writer lol

Cheers,

Andrew :-)

Published Thursday, June 26, 2008 5:07 PM by REA_ANDREW

Comments

# re: MetaWeblog API, Windows Live Writer - Adding Categories

Sunday, August 31, 2008 9:33 PM by Bobby Cannon

Have you found an answer for your situation? I am facing the same issue...

# re: MetaWeblog API, Windows Live Writer - Adding Categories

Monday, September 01, 2008 4:47 AM by REA_ANDREW

Yeh, when you have the category box visible like I have posted above, you can add categories to the list.  When you submit or publish your blog it sends these categories to your META WEBLOG API.  What I then do is parse the category string, and first add any categories that do not exist on the database.  I can then assign each a category ID and subsequently attach to the blog article.

You function for get categories should now also gring back these newly added categories, so your list is persisted and updated.  OK you might have to click refresh.

Hope this helps.

Leave a Comment

(required) 
(required) 
(optional)
(required)