Thursday, May 28, 2009

Integrating BlogEngine into an existing website











Introduction to Blog Engine.Net -






BlogEngine.NET is open source .BlogEngine.NET is a full-featured blogging platform that is a breeze to set up, customize, and use. BlogEngine.NET works with your choice of data source; you may use SQL Server, or you may take the plug'n'play approach using XML files.

















  • Plug 'n' Play
    BlogEngine.NET is very easy to setup and customize. To make it work, just upload the files to an ASP.NET 2.0 webserver and you're ready to start writing. No database configuration, just plug'n'play.





  • Full Featured
    BlogEngine.NET comes with all the features you would expect from a modern blog engine as well as new unique features such as AJAX comments and screenshot trackbacks.





  • Web 2.0
    BlogEngine.NET features social bookmarks, OpenSearch support, XFN tags, AJAX, Microsummaries, Gravatars, coComments, tag cloud, Google sitemap and other so-called Web 2.0 features.





  • Cool Themes
    BlogEngine.NET comes with some very cool themes for you to choose from. If you want to modify or create a new theme you can do so easily with just a basic understanding of HTML and CSS.





  • XHTML Compliance
    All the controls in BlogEngine.NET are 100% XHTML 1.0 compliant. All posts you write automatically becomes compliant thanks to the tinyMCE text editor.





  • Extendable
    BlogEngine.NET is built from the ground up using nothing but C# and ASP.NET 2.0 all with simplicity in mind. It means that you can write new controls and themes by using the skills you already have as a .NET developer.





Above information about BlogEngine I have picked from http://www.asp.net/ website.I don't want to describe more about information regarding blog my concern only how to integrate it to existing website.






BlogeEngine support three kinds of membership providers-






We have to change setting in web.config according to your requirement .First of all change setting in custom section blogprovider .






<configSections>






<sectionGroup
name="BlogEngine">






<section
name="blogProvider"
requirePermission="false"
type="BlogEngine.Core.Providers.BlogProviderSection, BlogEngine.Core"
allowDefinition="MachineToApplication"
restartOnExternalChanges="true"/>






</sectionGroup>






</configSections>






<BlogEngine>






<blogProvider
defaultProvider="DbBlogProvider">






<providers>






<!--<add name="XmlBlogProvider" type="BlogEngine.Core.Providers.XmlBlogProvider, BlogEngine.Core"/>-->






<add
name="DbBlogProvider"
type="BlogEngine.Core.Providers.DbBlogProvider, BlogEngine.Core"
connectionStringName="BlogEngine" />






</providers>






</blogProvider>






</BlogEngine>






















  1. XmlMembershipProvider: - All data store in App_Data directory of Asp.net .so full rights must be applied on this folder.





    Web.Config setting –




































<membership
defaultProvider=" XmlMembershipProvider ">






<providers>






<clear/>






<add
name="XmlMembershipProvider"
type="BlogEngine.Core.Providers.XmlMembershipProvider, BlogEngine.Core"
description="XML membership provider"
passwordFormat="Hashed"/>












</providers>






</membership>












<roleManager
defaultProvider=" XmlRoleProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".BLOGENGINEROLES">






<providers>






<clear/>






<add
name="XmlRoleProvider"
type="BlogEngine.Core.Providers.XmlRoleProvider, BlogEngine.Core"
description="XML role provider"/>












</providers>






</roleManager>






















  1. SqlMembershipProvider :- If your application using AspnetMembership then this option will be more useful.











    Web.Config setting –






























<membership
defaultProvider="SqlMembershipProvider">






<providers>






<clear/>






<add
name="SqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="BlogEngine"
applicationName="BlogEngine"/>






</providers>






</membership>












<roleManager
defaultProvider="SqlRoleProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".BLOGENGINEROLES">






<providers>






<clear/>






<add
name="SqlRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="BlogEngine"
applicationName="BlogEngine"/>






</providers>






</roleManager>






















  1. DbMembershipProvider : - If your website using your on authentication using rather than aspnetmembership then this option will be best.











    Web.config settings :












<membership
defaultProvider="DbMembershipProvider">






<providers>






<clear/>






<add
name="DbMembershipProvider"
type="BlogEngine.Core.Providers.DbMembershipProvider, BlogEngine.Core"
passwordFormat="Clear"
connectionStringName="BlogEngine"/>






</providers>






</membership>












<roleManager
defaultProvider="DbRoleProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".BLOGENGINEROLES">






<providers>






<clear/>






<add
name="DbRoleProvider"
type="BlogEngine.Core.Providers.DbRoleProvider, BlogEngine.Core"
connectionStringName="BlogEngine"/>






</providers>






</roleManager>












All of three them I want to describe DbMembershipProvider because other two no need to describe more here. lot of websites using own authentication mechanism so DbMembershipProvider will be best way to integration in my opinion.






Following changes should be made in BlogEngine.Core assembly:-






DB Provider classes are shown in following diagram:-































  1. Change table prefix in DbMembershipProvider.cs . Either set your table prefix or blank



































  1. Change table name and field name according to your database in DbMembershipProvider.cs class
























  2. Change table prefix , table name and field name according to your database in DbMembershipProvider.cs class





























  3. Define roles according to your database entries in web.sitemap


















    Summary:- BlogEngine.Net is best open source blog application that provide very simple integration providers






    We can also implement DBMebershipProvider for custom provider in our application.






2 comments:

Sony NX810 said...

Nice tutorial, thanks for sharing it.

Tom Watson said...

Any additional consumers you can find so that you can store your articles chanel bags for sale, greater considerable it seems like to help bing and thus some sort of enhanced standing inside the se. Givealink Bookmark