Integration with existing website

Topics: Business Logic Layer, Controls, Themes
Dec 31, 2013 at 4:44 AM
Edited Dec 31, 2013 at 5:18 AM
I am new to blogengine and hope to get some help so I can get onto the right direction. So thanks in advance.
Here is my situation: I have a website written in mvc4.0. The website has many sales users each user can own many zipcode. Once they logged into the system we know which zipcode they belong to. The system uses SqlMembershipProvider and SqlRoleProvider for authentication and authorization. Now we like to add blog so sales user can blog in their zipcode. It is a many to many relationship. We have two websites one is public website that for consumers to view blogs and interact with sales people. The other is intranet where sales user can create/edit/publish/delete post. I assume that the best way to handle this is to keep blog engine and our website separate. Please let me know if this is not the case. Here are my questions:
  1. Is blogengine the right app for this? Will 2.9 make this integration easier?
  2. If so should we use or for blog section?
  3. Can we create theme the will look like my current site?
  4. How much work is this?
  5. Any guide on how to implement something like this?
Thanks again and wish everyone a great successful new year!

Dec 31, 2013 at 8:33 PM
General rule is: it is easy to run blog side-by-side with other application ( and tough to fully integrate/merge into other application. Blogengine uses provider model to plug in its own membership, it also multi-blog so it adds blog instance ID to authentication cookie which makes it harder to share with other app. Be 2.9 does not make any changes to membership, it is same as in 2.8.

You can add blog as sub-application on same domain with your main app and it would be pretty easy to automate generating blog for any users in main app if you need it (although do require some coding). You can easily create app/blog/username blog for every user in main app. Sub domains are tough, having app/blog instead of will save lots of time.

Creating theme from existing template is very easy so visually it can look as part of your main application. You can check my blog on theme tutorials, they very simple.
Dec 31, 2013 at 11:32 PM
Edited Jan 1, 2014 at 12:28 AM
Thanks so much for your timely response. You have no idea how much I appreciate this. It definitely sounds like doable. Couple of more questions:
  1. It seems that I can create something like blog for each zipcode and have a group of user under each blog. The question is can I create a user for a given blog through some sort of API? Because we have an intranet to assign each sales to an area.
  2. I believe we can switch from xml based data store to sql based data store through advanced settings. The question I have is can I separate SqlMembershipProvider and SqlRoleProvider portion of the data tables from blog related tables. It looks like to me membership, roleManager and blogProvider can all be configured separately. The only connection is among them is connectionStringName which is BlogEngine. And blogProvider doesn't have application name. I believe all I need to do for single sign on is to change the connectionStringName and application name in SqlMembershipProvider and SqlRoleProvider to the same as my other app. Am I right? My question is how do I create the initial admin/admin account. The reason is I already have a database with all the authentication/authorization tables. If so are there any documents or link that I can follow to get this done.
Thanks again
Jan 1, 2014 at 6:03 AM
Edited Jan 1, 2014 at 6:28 AM
Ok, just got SqlMembershipProvider and SqlRoleProvider to work with existing database. I believe the blog side is handled through xml. It is quiet straight forward. Going to try single sign on next. I might just leave the blog side as xml for now. So the second question has been answered now.

Still like to find a way to limit user to a particular blog through some sort of API.

Jan 1, 2014 at 6:06 PM
You can look under app_code/api, there are number of web api controllers, including UserController.
Jan 2, 2014 at 5:24 PM
Edited Jan 2, 2014 at 5:42 PM
Thanks rtur for the tip. I looked at UserService.asmx (I couldn't find UserController so I assumed that what you meant?) and nothing appears to relate a user only to a particular blog. I know this can be done for example if you create new post for a particular blog it will only show up in the blog. But I still can't find a way to do it pragmatically. Do you know this can be done?

Also since this is off the topic of the original intention of the this thread I am going to create a new one for this topic.