Welcome Guest, you are in: Namespace

Configuring BlogEngine.NET for Sueetie

RSS
Modified on 2009/04/12 23:51 by daveburke Categorized as BlogEngine NET, Membership, Site Setup
Here we will provide step-by-step instructions on setting up BlogEngine.NET for use in a Sueetie Online Community Site. The version of BlogEngine.NET supported here is 1.4.5.

BlogEngine.NET and Sueetie Integration Overview

BlogEngine.NET is a pleasure to use and has many configuration options making its integration with Sueetie a simple matter, though with a few setup steps as listed below. In an Online Community environment we would want to support several blogs, which is not currently supported in BlogEngine.NET natively. The approach we're taking with Sueetie to support multiple blogs is to store user data in SQL Server to leverage Sueetie's ASPNET Membership support and all blog content in XML format in that blog's /app_data folder. All blogs share the 3 BE SQL tables, which we will detail below.

Download BlogEngine.NET Build 24796 Source and compile for .NET 3.5 Framework

BlogEngine.NET is available on CodePlex. Sueetie was initially released with BE.NET 1.4.5, but because it was essential to move to IIS7 Integrated mode (not supported in 1.4.5), we went with a newer build. While it is not a point release, it has worked flawlessly for us. You should be able to use the latest build of BE.NET, but the DIFF was created for Build 24796 so it might be easier.

BlogEngine.NET Build 24796

Download the BLOG DIFF files from Sueetie CodePlex site

BLOG DIFF source is available at the Sueetie CodePlex site in both ZIP and versioned source.

Add Sueetie.Web, \members and \admin Projects to BlogEngine.NET Solution



Create BE.NET User Data in SQL Server

Update the "BlogEngine" connection string in web.config so we can proceed with creating the SQL User data objects. We will not be executing any SQL scripts that are located in the BE.NET/Setup area supplied with BlogEngine.NET. Recall that we will be storing user data in SQL Server and all blog content in /app_data in XML format to support multiple blogs. The schema to support this shared BlogEngine.NET/Sueetie User configuration is very simple as you can see below.

Simple SQL Schema Supporting BE.NET Users

A Blog SQL Setup Script is located in the SQLScripts.zip and /sql source area titled "gummybear_blogsetup.sql" which will create the be_users, be_roles and be_userroles tables with examples of adding a site-wide global administrator ("admin" in the "BlogAdministrator" role) and an editor role for a specific blog ("testguy" in the "SiteBlogAdministrator" role.)

All ASPNET site users in a community must have a record in be_user. Consequently you will need to execute SueetieAddUser.sql to add any users to be_user table beyond the default "admin" and "testguy" users during setup to avoid a BE.NET runtime error. User records will be created during the Sueetie Registration process, so to add support for BlogEngine.NET uncomment the Sql-to-LINQ code in /members/Register.aspx.cs that creates a user record in be_user for all new ASPNET site accounts. Since /members (like /Web and BlogEngine.NET /Blog) is a Web Site Project, no recompile is required.

Sueetie Blog Roles

Two Sueetie ASPNET Roles support the first, default instance of BlogEngine.NET. They are "BlogAdministrator" and "SiteBlogEditor." BlogAdministrator has full rights while the SiteBlogEditor has the Editor capabilities built-in with BlogEngine.NET. For multiple blogs on a Sueetie Community, each blog (or blog group) would require a unique role to designate Blog Editor status. BlogAdministrator role has global blog permissions. An example would be where two blogs are supported: a Site Blog and a "FAQ" Blog. Two different users have Editor permissions on each blog, with a "FAQBlogEditor" role assigned to the Editor of the FAQ blog.

Setup IIS for BlogEngine.NET

Create /blog application directory. Give the IIS identity user read-write permissions to /App_Data folder where all content will be saved in XML for that blog.

BlogEngine.NET final touches

THIS MAY OR MAY NOT OCCUR ON LATER BUILDS OF BE.NET. IT WAS AN ISSUE WITH 1.4.5. On your BlogEngine.NET sidebar, login with the "admin" account or user in the BlogAdministrator role and remove the Administration widget shown here.

Sidebar Admin Widget to be removed

Otherwise all ASPNET users visiting blog will see an Administrative Widget with a single "Change Password" link. Because of the ASPNET Membership integration with Sueetie and BE.NET, blog editors have a link to the Blog's Administration area in the header links.

Blog Editor Blog Administration Link

Possible BlogEngine.NET Extensions Administration Issue

The BE.NET Extensions Administrative page could produce an irresolvable redirect. (This can occur with the ScrewTurn Wiki in development and is usually resolved by clearing domain cookies and logging back in.) The BE.NET Extensions issue can be resolved by updating the web.config in "/blog/admin/Extension Manager."

The issue is that the web.config restricts access to the "Administrators" Role. Sueetie uses "BlogAdministrator" so no access results in the irresolvable redirect. Here is a Sueetie compliant web.config for the folder to fix the issue.

<configuration>
  <location path="default.aspx">
    <system.web>
      <authorization>
        <allow roles="BlogAdministrator"/>
        <deny users="*" />
      </authorization>
    </system.web>
  </location>
</configuration> 

Since I'm now aware of the issue, I'll make sure this is covered in future DIFFs so once that occurs it should no longer be a problem.

BlogEngine.NET Data Storage and Integration with Sueetie

As described above, to support multiple blogs on a Sueetie community site as well as group, BlogEngine.NET blog data is stored as XML format in the blog's /app_data directory, with blog user data stored in SQL Server. To provide more robust Sueetie Framework processes, it was necessary to copy blog data into SQL Server. That design is described in BlogEngine.NET and Sueetie Data Integration.

ScrewTurn Wiki version 3.0.2.500.


This site was built with the Sueetie .NET Online Community Framework. Learn more about Sueetie at Sueetie.com.