July 2005 - Posts

Earlier I said:

call them "labels" or "tags" but give me a way to categorize my thoughts. Please.

Thanks, Atom 1.0 

[ Currently Playing : A Message - Coldplay - X&Y (04:45) ]

Darren's looking for ideas on how to migrate data from one blog engine to the next. This has been discussed before a lot, I'm sure, but it's not a bad conversation to have.

So what's the answer? Sorry, I don't have that. I know that it would have been nice when developing PostXING to have an api that gives you more control or gives better querying ability, and I also know that none of the APIs that Darren talks about are it. For all of the metablog api's shortcomings, I find it at least decent enough to not have made a post using the web interface of my blogs since writing PostXING. I agree with Darren that the atom api does not seem complete. No categories? That's weird. If you're worried about being different from rss in some small way (and come on, that's what it's about in the first place, innit?) call them "labels" or "tags" but give me a way to categorize my thoughts. Please.

One person whose thoughts I'd like to hear on the idea of a better blogging api is ScottW who has written a few external apis for different evolutions of the popular aspnetweblog software that we all know and love and call CS::Blogs these days.

A better blogging API

I'll also do some searching over the next week or so to see what others have been discussing around this topic as it is obviously something which must have come up a lot.  Maybe we have to wait until industry heavyweights start to build blogging products into their core platforms before clear spec's start to emerge around what is needed from an API that would allow for the programmatic disovery and interaction with blogs. 

And then, who knows how long it will take for the current blog engines to implement that?

[Via MarkItUp - Thinking Products]

You're Welcome! Big Smiley 

[ Currently Playing : Suite-Pee - System of a Down - System of a Down (2:32) ]

I couldn't find a cut & dry solution to this (probably b/c it's too simple for anyone to think they would need an example) so here's how I got an xml file embedded as a resource in a vs2003 project written to the filesystem.

First, you just add an xml file with some default information you want for it to your project and change its build action to Embedded Resource. Then, you find the name of the resource (it can be tricky if you have a few folders) by opening up ildasm and double clicking the MANIFEST node. Using that resource name, you would do something like this:

using System;
using System.IO;
using System.Xml;
using System.Reflection;

string path = Path.Combine(
Environment.GetFolderPath(
Environment.SpecialFolder.ApplicationData), 
Application.CompanyName);

path = Path.Combine(path, Application.ProductName);
path = Path.Combine(path, subFolder);
path = Path.Combine(path, "fileName.xml");

if(!File.Exists(path)){
	Assembly thisAssembly = Assembly.GetExecutingAssembly();
	Stream rgbxml = thisAssembly.GetManifestResourceStream(
"YourNamespace.fileName.xml");			
	XmlDocument doc = new XmlDocument();
	doc.Load(rgbxml);

	doc.PreserveWhitespace = true;
	doc.Save(path);					
}

A couple of things to note about this: it's for a WinForms application, so I can use the Application class to get things in AssemblyInfo.cs (like ProductName, CompanyName). Also, you could probably do this anywhere but I chose to put a lot of my default configuration under the user's ApplicationData folder, where most users (can't say for sure about the guest account since that's been disabled here for a long time) have authority to write.

http://support.microsoft.com/?id=555022

I've needed this a couple of times, what better way to find it? ;)

Was just released. In the newsletter, it said that you can use a DocumentContainer (tabs) outside of a SandDockManager - simple tabbing with the same interface that is all over PostXING. Sounds promising!

Well, the "document" tabs only render at the top, and I need tabs at the bottom to keep the interface at least a little similar to what it always has been. Plus, with the interface that I have in PostXING, I just like the way the tabs look at the bottom better. So I have two choices: keep the interface that is already in place (using the older (free) version of Magic) or have tabs at the top, right? Nope.

I found a way to use the docking windows (that show their tabs at the bottom) to get the effect that I wanted.

First, I created a usercontrol and added four docking windows (with tabs). Then I expanded the dock control that holds the windows to be the same width as the usercontrol and anchored to top | left | right. After that, I basically disabled all docking, closing, and extra actions. At a pinch of graphics, and this is what I get:

Nice, huh? Well, I thought it was anyways :)

This was the error that was biting me on PostXING v2 for almost a week (I usually only get insomnia hours to debug. That can be frustrating.)

The first thing that I noticed was that the wonderful interfaces that I was using would end up null after my first visit to a particular configuration page. It's something about the way that a "Page" is saved and loaded - it requires ViewState! Forreal! I'd gotten so used to having state within my smart clients that I had almost forgot about reconstructing state.

Now that I had that taken care of, I was getting an exception returned from what seemed to be the service endpoint of the metablog api. But wait a second - I'm using nearly the same code in v1. So I think, hey, I'll go ahead and use exactly the same code from v1 and put that in there - that'll surely work, right?

using System;
using CookComputing.XmlRpc;

namespace PostXING.MetaBlogProvider
{
	/// <summary>
	/// BlogRequest wraps the blogger api getUsersBlog xml-rpc method.
	/// </summary>
	public class BlogRequest : XmlRpcClientProtocol
	{
		public BlogRequest(){	}

		[XmlRpcMethod("blogger.getUsersBlogs",
			 Description="Returns information on all the blogs a given user "
			 + "is a member.")]
		public bgBlogInfo[] getUsersBlogs(string appKey,string username,string password) {
			return (bgBlogInfo[])Invoke("getUsersBlogs",new object[]{appKey,username,password});
		}
	}
}

 

Nope, same exception (the title of this post). After the dent in my head grew to about three inches, I decided to look at the version of xml-rpc.net that I was using. Hmm, 0.8. What version was the endpoint using? Double hmm, 0.9. Could it be a simple version mismatch that was my problem giving me this cryptic error?

Yep.

I just set up CS::Blogs 1.1 on my server over here and I wanted to keep ReverseDOS going for it. So I just copied over the settings from my web.config and thought I would be gold...not so, grasshopper.

The new section in the default web.config is now named memberrolesprototype so if you want to upgrade and not have to pull your hair out, keep this in mind.

update:

	<memberrolesprototype>
		<ReverseDOS>
			<settings enabled="true" debugEnabled="false" debugKey="oink=225678" hideExceptions="true" />

[ Currently Playing : The World Has Turned and Left - Weezer - Weezer (Blue Album) (4:18) ]

...to having something that actually works :) Do you think I'm going a little nuts with the logo?

More Posts