This project is read-only.

Integrating blogsvc in an existing website

Oct 26, 2008 at 10:40 AM
First of all: I'm really impressed with this project, it sure looks promising! Nice work!

I was wondering whether it was possible / feasible to integrate Blog Service into an existing site. I have an (MVC) site in which I want to integrate (simple) blogging functionality. Instead of reinventing the wheel for the millionth time I prefer to integrate an engine like this into my site. From what I've seen from the source code this should be possible as you've nicely decoupled all functionality in layers.

Basically I would need some of the controllers and a number of the views and some way to use my existing authentication information.

Do you have any hints, tips, or directions on how I can do this most easily?
Oct 31, 2008 at 10:32 PM
Thanks for the kind words.

Yes, it should be possible to integrate with an existing site.  The quickest way to get BlogSvc up and running on an existing site is to just dump it in a virtual directory.
However, to actually integrate with your existing site you could try merging the two.  You can start with:

* Routing in Global.asax
* AuthenticateService to utilize your authentication system (membership provider?)

Can you explain what your existing site does?  What dependencies does it have?
Nov 3, 2008 at 5:29 PM
My site allows visitors to keep track on their running times and allows them to share them with other users. I would like to offer users to possibility to have their own running blog.

Instead of writing it myself I much rather use a framework like blogsvc. But I don't need all functionality, and the layout has to fit and integrate into my site.

From what I've seen this should be possible with reuse of the controllers and a custom implementation of the views.

Most important question is how to support multiple different (isolated) authors / users / blogs from one installation. Is this possible with blogsvc?
Nov 3, 2008 at 10:23 PM
Yes, blogsvc was designed to support multiple different authors/blogs in one installation.  You will have one workspace per author.  Each workspace will have two collections.  One for blog posts and one for images/media... (only if you want to host images and videos).

The layout is extremely flexible through the use of themes.  You could also create your own views if you don't like the ones provided.

How are you currently authenticating users?  Membership provider?
Nov 4, 2008 at 1:23 PM
Thanks for the explanation. I'm going to try to see how that would work for my site.

I'm using the default (forms) membership provider for authentication. From what I've seen blogsvc uses openID authentication? Would it be possible to use the default authentication provider?
Nov 9, 2008 at 12:48 PM
Well, I got some more questions about integrating blogsvc into a custom site. My site is hosted on a shared host with partial trust. I tested this, and since the OpenId assembly is not marked with the [AllowPartiallyTrustedCallers] Attribute the openID support won't work on a shared host. I tried removing this part  (and related code) and that makes it work in a medium trust environment. I think it would be good to make the reference on OpenID optional to allow blogsvc to run in a partially trusted environment.

I did some reading on the AtomPub protocol and browsed the sources but I still have some questions, hopefully you can help me out:
* As far as I see there are no API's in the blogsvc.Service that allow Workspace / collection creation on the fly. Is it hard to write code to make this possible?
* Would it be possible to use membership authentication instead of openID?
Nov 12, 2008 at 5:26 PM
I'll look at making the OpenID reference optional.

There is currently no API for creating workspaces and collections.  However, the UpdateService method was meant to allow support for this.  It should actually be pretty easy.  Just add a workspace/collection to the service and then call Update Service.

Using membership provider is possible.  The only caveat there is hashed passwords are not compatible with the WSSE authentication on the AtomPub service.  However, this can easily be changed to basic authentication.
Nov 15, 2008 at 10:45 AM
Workspaces and collections via UpdateService is in place for the SQL provider. Testing this scenario on the File provider will happen soon.