C# Class BlogEngine.Core.Providers.DbBlogProvider

Generic Database BlogProvider
Inheritance: BlogProvider
Show file Open project: rasmuskl/ReSharperCourse

Public Methods

Method Description
DeleteBlog ( Blog blog ) : void

Deletes a Blog from the database

DeleteBlogRollItem ( BlogRollItem blogRollItem ) : void

Deletes a BlogRoll from the database

DeleteBlogStorageContainer ( Blog blog ) : bool

Deletes the blog's storage container.

DeleteCategory ( Category category ) : void

Deletes a category from the database

DeletePackage ( string packageId ) : void

Should delete package and remove all package files

DeletePage ( Page page ) : void

Deletes a page from the database

DeletePost ( Post post ) : void

Deletes a post in the database

DeleteProfile ( AuthorProfile profile ) : void

Remove AuthorProfile from database

DeleteQuickNote ( System.Guid noteId ) : void

Delete quick note

FillBlogRoll ( ) : List

Gets all BlogRolls in database

FillBlogs ( ) : List

Gets all Blogs in database

FillCategories ( ) : List

Gets all categories in database

FillPackageFiles ( string packageId ) : List

Gets list of files for installed package

FillPackages ( ) : List

Gets all installed from gallery packages

FillPages ( ) : List

Gets all pages in database

FillPosts ( ) : List

Gets all post from the database

FillProfiles ( ) : List

Return collection for AuthorProfiles from database

FillQuickNotes ( string userId ) : List

Fill quick notes

FillQuickSettings ( string userId ) : List

Fill quick settings

FillReferrers ( ) : List

Gets all Referrers from the database.

FillRights ( ) : IEnumerable>.IDictionary
Initialize ( string name, NameValueCollection config ) : void

Initializes the provider

InsertBlog ( Blog blog ) : void

Adds a new blog to the database.

InsertBlogRollItem ( BlogRollItem blogRollItem ) : void

Adds a new BlogRoll to the database.

InsertCategory ( Category category ) : void

Adds a new category to the database

InsertPage ( Page page ) : void

Adds a page to the database

InsertPost ( Post post ) : void

Adds a new post to database

InsertProfile ( AuthorProfile profile ) : void

Adds AuthorProfile to database

InsertReferrer ( Referrer referrer ) : void

Adds a new Referrer to the database.

LoadFromDataStore ( ExtensionType extensionType, string extensionId ) : object

Load user data from DataStore

LoadPingServices ( ) : StringCollection

Gets the PingServices from the database

LoadSettings ( ) : StringDictionary

Gets the settings from the database

LoadStopWords ( ) : StringCollection

Get stopwords from the database

RemoveFromDataStore ( ExtensionType extensionType, string extensionId ) : void

Deletes an item from the dataStore

SavePackage ( BlogEngine.Core.Packaging.InstalledPackage package ) : void

Log of all installed packages

SavePackageFiles ( List packageFiles ) : void

Log of all files for installed package

SavePingServices ( StringCollection services ) : void

Saves the PingServices to the database

SaveQuickNote ( QuickNote note ) : void

Save quick note

SaveQuickSetting ( QuickSetting setting ) : void

Save quick setting

SaveRights ( IEnumerable rights ) : void
SaveSettings ( StringDictionary settings ) : void

Saves the settings to the database

SaveToDataStore ( ExtensionType extensionType, string extensionId, object settings ) : void

Save to DataStore

SelectBlog ( System.Guid id ) : Blog

Gets a Blog based on a Guid.

SelectBlogRollItem ( System.Guid id ) : BlogRollItem

Gets a BlogRoll based on a Guid.

SelectCategory ( System.Guid id ) : Category

Returns a category

SelectPage ( System.Guid id ) : Page

Returns a page for given ID

SelectPost ( System.Guid id ) : Post

Returns a Post based on Id.

SelectProfile ( string id ) : AuthorProfile

Loads AuthorProfile from database

SelectReferrer ( System.Guid id ) : Referrer

Gets a Referrer based on an Id.

SetupBlogFromExistingBlog ( Blog existingBlog, Blog newBlog ) : bool

Sets up the required storage files/tables for a new Blog instance, from an existing blog instance.

UpdateBlog ( Blog blog ) : void

Saves an existing Blog to the database

UpdateBlogRollItem ( BlogRollItem blogRollItem ) : void

Saves an existing BlogRoll to the database

UpdateCategory ( Category category ) : void

Saves an existing category to the database

UpdatePage ( Page page ) : void

Saves an existing page in the database

UpdatePost ( Post post ) : void

Saves and existing post in the database

UpdateProfile ( AuthorProfile profile ) : void

Updates AuthorProfile to database

UpdateReferrer ( Referrer referrer ) : void

Saves an existing Referrer to the database.

Private Methods

Method Description
AddBlogParametersToCommand ( Blog blog, DbConnectionHelper conn, DbCommand cmd ) : void

Adds blog parameters to command.

AddBlogRollParametersToCommand ( BlogRollItem blogRollItem, DbConnectionHelper conn, DbCommand cmd ) : void

The add blog roll parameters to command.

AddReferrersParametersToCommand ( Referrer referrer, DbConnectionHelper conn, DbCommand cmd ) : void

The add referrers parameters to command.

CreateConnection ( ) : DbConnectionHelper

Creates a new DbConnectionHelper for this DbBlogProvider instance.

DeleteOldReferrers ( ) : void

The delete old referrers.

FormatParamName ( string parameterName ) : string

Returns a formatted parameter name to include this DbBlogProvider instance's paramPrefix.

UpdateCategories ( Post post, DbConnectionHelper conn ) : void

The update categories.

UpdateComments ( Post post, DbConnectionHelper conn ) : void

The update comments.

UpdateNotify ( Post post, DbConnectionHelper conn ) : void

The update notify.

UpdateTags ( Post post, DbConnectionHelper conn ) : void

The update tags.

Method Details

DeleteBlog() public method

Deletes a Blog from the database
public DeleteBlog ( Blog blog ) : void
blog Blog /// The blog. ///
return void

DeleteBlogRollItem() public method

Deletes a BlogRoll from the database
public DeleteBlogRollItem ( BlogRollItem blogRollItem ) : void
blogRollItem BlogRollItem /// The blog Roll Item. ///
return void

DeleteBlogStorageContainer() public method

Deletes the blog's storage container.
public DeleteBlogStorageContainer ( Blog blog ) : bool
blog Blog /// The blog. ///
return bool

DeleteCategory() public method

Deletes a category from the database
public DeleteCategory ( Category category ) : void
category Category /// category to be removed ///
return void

DeletePackage() public method

Should delete package and remove all package files
public DeletePackage ( string packageId ) : void
packageId string Package ID
return void

DeletePage() public method

Deletes a page from the database
public DeletePage ( Page page ) : void
page Page /// page to be deleted ///
return void

DeletePost() public method

Deletes a post in the database
public DeletePost ( Post post ) : void
post Post /// post to delete ///
return void

DeleteProfile() public method

Remove AuthorProfile from database
public DeleteProfile ( AuthorProfile profile ) : void
profile AuthorProfile An AuthorProfile.
return void

DeleteQuickNote() public method

Delete quick note
public DeleteQuickNote ( System.Guid noteId ) : void
noteId System.Guid Note ID
return void

FillBlogRoll() public method

Gets all BlogRolls in database
public FillBlogRoll ( ) : List
return List

FillBlogs() public method

Gets all Blogs in database
public FillBlogs ( ) : List
return List

FillCategories() public method

Gets all categories in database
public FillCategories ( ) : List
return List

FillPackageFiles() public method

Gets list of files for installed package
public FillPackageFiles ( string packageId ) : List
packageId string Package ID
return List

FillPackages() public method

Gets all installed from gallery packages
public FillPackages ( ) : List
return List

FillPages() public method

Gets all pages in database
public FillPages ( ) : List
return List

FillPosts() public method

Gets all post from the database
public FillPosts ( ) : List
return List

FillProfiles() public method

Return collection for AuthorProfiles from database
public FillProfiles ( ) : List
return List

FillQuickNotes() public method

Fill quick notes
public FillQuickNotes ( string userId ) : List
userId string User ID
return List

FillQuickSettings() public method

Fill quick settings
public FillQuickSettings ( string userId ) : List
userId string User ID
return List

FillReferrers() public method

Gets all Referrers from the database.
public FillReferrers ( ) : List
return List

FillRights() public method

public FillRights ( ) : IEnumerable>.IDictionary
return IEnumerable>.IDictionary

Initialize() public method

Initializes the provider
public Initialize ( string name, NameValueCollection config ) : void
name string /// Configuration name ///
config System.Collections.Specialized.NameValueCollection /// Configuration settings ///
return void

InsertBlog() public method

Adds a new blog to the database.
public InsertBlog ( Blog blog ) : void
blog Blog /// The blog. ///
return void

InsertBlogRollItem() public method

Adds a new BlogRoll to the database.
public InsertBlogRollItem ( BlogRollItem blogRollItem ) : void
blogRollItem BlogRollItem /// The blog Roll Item. ///
return void

InsertCategory() public method

Adds a new category to the database
public InsertCategory ( Category category ) : void
category Category /// category to add ///
return void

InsertPage() public method

Adds a page to the database
public InsertPage ( Page page ) : void
page Page /// page to be added ///
return void

InsertPost() public method

Adds a new post to database
public InsertPost ( Post post ) : void
post Post /// The new post. ///
return void

InsertProfile() public method

Adds AuthorProfile to database
public InsertProfile ( AuthorProfile profile ) : void
profile AuthorProfile An AuthorProfile.
return void

InsertReferrer() public method

Adds a new Referrer to the database.
public InsertReferrer ( Referrer referrer ) : void
referrer Referrer /// Referrer to add. ///
return void

LoadFromDataStore() public method

Load user data from DataStore
public LoadFromDataStore ( ExtensionType extensionType, string extensionId ) : object
extensionType ExtensionType /// type of info ///
extensionId string /// id of info ///
return object

LoadPingServices() public method

Gets the PingServices from the database
public LoadPingServices ( ) : StringCollection
return System.Collections.Specialized.StringCollection

LoadSettings() public method

Gets the settings from the database
public LoadSettings ( ) : StringDictionary
return System.Collections.Specialized.StringDictionary

LoadStopWords() public method

Get stopwords from the database
public LoadStopWords ( ) : StringCollection
return System.Collections.Specialized.StringCollection

RemoveFromDataStore() public method

Deletes an item from the dataStore
public RemoveFromDataStore ( ExtensionType extensionType, string extensionId ) : void
extensionType ExtensionType /// type of item ///
extensionId string /// id of item ///
return void

SavePackage() public method

Log of all installed packages
public SavePackage ( BlogEngine.Core.Packaging.InstalledPackage package ) : void
package BlogEngine.Core.Packaging.InstalledPackage Intalled package
return void

SavePackageFiles() public method

Log of all files for installed package
public SavePackageFiles ( List packageFiles ) : void
packageFiles List List of intalled package files
return void

SavePingServices() public method

Saves the PingServices to the database
public SavePingServices ( StringCollection services ) : void
services System.Collections.Specialized.StringCollection /// collection of PingServices ///
return void

SaveQuickNote() public method

Save quick note
public SaveQuickNote ( QuickNote note ) : void
note BlogEngine.Core.Notes.QuickNote Quick note
return void

SaveQuickSetting() public method

Save quick setting
public SaveQuickSetting ( QuickSetting setting ) : void
setting BlogEngine.Core.Notes.QuickSetting Quick setting
return void

SaveRights() public method

public SaveRights ( IEnumerable rights ) : void
rights IEnumerable
return void

SaveSettings() public method

Saves the settings to the database
public SaveSettings ( StringDictionary settings ) : void
settings System.Collections.Specialized.StringDictionary /// dictionary of settings ///
return void

SaveToDataStore() public method

Save to DataStore
public SaveToDataStore ( ExtensionType extensionType, string extensionId, object settings ) : void
extensionType ExtensionType /// type of info ///
extensionId string /// id of info ///
settings object /// data of info ///
return void

SelectBlog() public method

Gets a Blog based on a Guid.
public SelectBlog ( System.Guid id ) : Blog
id System.Guid /// The Blog's Guid. ///
return Blog

SelectBlogRollItem() public method

Gets a BlogRoll based on a Guid.
public SelectBlogRollItem ( System.Guid id ) : BlogRollItem
id System.Guid /// The BlogRoll's Guid. ///
return BlogRollItem

SelectCategory() public method

Returns a category
public SelectCategory ( System.Guid id ) : Category
id System.Guid Id of category to return
return Category

SelectPage() public method

Returns a page for given ID
public SelectPage ( System.Guid id ) : Page
id System.Guid /// ID of page to return ///
return Page

SelectPost() public method

Returns a Post based on Id.
public SelectPost ( System.Guid id ) : Post
id System.Guid /// The Post ID. ///
return Post

SelectProfile() public method

Loads AuthorProfile from database
public SelectProfile ( string id ) : AuthorProfile
id string The user name.
return AuthorProfile

SelectReferrer() public method

Gets a Referrer based on an Id.
public SelectReferrer ( System.Guid id ) : Referrer
id System.Guid /// The Referrer Id. ///
return Referrer

SetupBlogFromExistingBlog() public method

Sets up the required storage files/tables for a new Blog instance, from an existing blog instance.
public SetupBlogFromExistingBlog ( Blog existingBlog, Blog newBlog ) : bool
existingBlog Blog /// The existing blog to copy from. ///
newBlog Blog /// The new blog to copy to. ///
return bool

UpdateBlog() public method

Saves an existing Blog to the database
public UpdateBlog ( Blog blog ) : void
blog Blog /// Blog to be saved ///
return void

UpdateBlogRollItem() public method

Saves an existing BlogRoll to the database
public UpdateBlogRollItem ( BlogRollItem blogRollItem ) : void
blogRollItem BlogRollItem /// BlogRoll to be saved ///
return void

UpdateCategory() public method

Saves an existing category to the database
public UpdateCategory ( Category category ) : void
category Category /// category to be saved ///
return void

UpdatePage() public method

Saves an existing page in the database
public UpdatePage ( Page page ) : void
page Page /// page to be saved ///
return void

UpdatePost() public method

Saves and existing post in the database
public UpdatePost ( Post post ) : void
post Post /// post to be saved ///
return void

UpdateProfile() public method

Updates AuthorProfile to database
public UpdateProfile ( AuthorProfile profile ) : void
profile AuthorProfile /// An AuthorProfile. ///
return void

UpdateReferrer() public method

Saves an existing Referrer to the database.
public UpdateReferrer ( Referrer referrer ) : void
referrer Referrer /// Referrer to be saved. ///
return void