C# Class Subtext.Framework.Data.DatabaseObjectProvider

ファイルを表示 Open project: ayende/Subtext Class Usage Examples

Public Methods

Method Description
ClearBlogContent ( int blogId ) : void
Create ( Enclosure enclosure ) : int
Create ( Entry entry, int categoryIds ) : int

Creates the specified entry in the back end data store attaching the specified category ids.

Create ( FeedbackItem feedbackItem ) : int
Create ( MetaTag metaTag ) : int
CreateBlog ( string title, string userName, string password, string host, string subfolder ) : bool

Adds the initial blog configuration. This is a convenience method for allowing a user with a freshly installed blog to immediately gain access to the admin section to edit the blog.

CreateBlog ( string title, string userName, string password, string host, string subfolder, int blogGroupId ) : bool

Adds the initial blog configuration. This is a convenience method for allowing a user with a freshly installed blog to immediately gain access to the admin section to edit the blog.

CreateBlogAlias ( BlogAlias alias ) : bool
CreateLink ( Link link ) : int
CreateLinkCategory ( LinkCategory lc ) : int
Delete ( int entryId ) : bool

Deletes the specified entry.

DeleteBlogAlias ( BlogAlias alias ) : bool
DeleteEnclosure ( int enclosureId ) : bool
DeleteImage ( int ImageID ) : bool
DeleteKeyWord ( int id ) : bool
DeleteLink ( int LinkID ) : bool
DeleteLinkCategory ( int CategoryID ) : bool
DeleteMetaTag ( int metaTagId ) : bool
DestroyFeedback ( FeedbackStatusFlag status ) : void
DestroyFeedback ( int id ) : void

Completely deletes the feedback from the system.

GetActiveCategories ( ) : IList
GetBlogAliasById ( int aliasId ) : BlogAlias
GetBlogByDomainAlias ( string host, string subfolder, bool strict ) : BlogInfo
GetBlogById ( int blogId ) : BlogInfo

Gets the blog by id.

GetBlogGroup ( int id, bool activeOnly ) : BlogGroup

Gets the blog group.

GetBlogInfo ( string hostname, string subfolder, bool strict ) : BlogInfo

Returns a BlogInfo instance containing the configuration settings for the blog specified by the Hostname and Application.

Until Subtext supports multiple blogs again (if ever), this will always return the same instance.

GetBlogPosts ( int itemCount, PostConfig pc ) : IList

Returns blog posts that meet the criteria specified in the PostConfig flags.

GetCategories ( CategoryType catType, bool activeOnly ) : IList

Gets the categories for the specified category type.

GetCommentByChecksumHash ( string checksumHash ) : Entry

Searches the data store for the first comment with a matching checksum hash.

GetConditionalEntries ( int itemCount, PostType postType, PostConfig postConfig, bool includeCategories ) : IList

Gets the entries that meet the specific PostType and the PostConfig flags.

This is called to get the main syndicated entries.

GetEntriesByCategory ( int itemCount, int catID, bool activeOnly ) : IList
GetEntriesByTag ( int itemCount, string tagName ) : IList
GetEntry ( int id, bool includeCategories ) : Entry

Returns an active Entry by the id regardless of which blog it is located in.

GetEntry ( int id, bool activeOnly, bool includeCategories ) : Entry

Returns an Entry with the specified id.

GetEntry ( string entryName, bool activeOnly, bool includeCategories ) : Entry

Returns an Entry with the specified entry name.

GetEntryDay ( DateTime dt ) : EntryDay
GetFeedback ( int id ) : FeedbackItem

Returns the feedback by id.

GetFeedbackCounts ( int &approved, int &needsModeration, int &flaggedAsSpam, int &deleted ) : void

Gets the feedback counts for the various top level statuses.

GetFeedbackForEntry ( Entry parentEntry ) : IList

Returns all the active entries for the specified post.

GetImage ( int imageID, bool activeOnly ) : Image
GetImagesByCategoryID ( int catID, bool activeOnly ) : ImageCollection
GetKeyWord ( int KeyWordID ) : KeyWord
GetKeyWords ( ) : IList
GetLink ( int linkID ) : Link
GetLinkCategory ( int categoryId, bool activeOnly ) : LinkCategory

Gets the link category for the specified category id.

GetLinkCategory ( string categoryName, bool activeOnly ) : LinkCategory

Gets the link category for the specified category name.

GetLinkCollectionByPostID ( int PostID ) : IList
GetMetaTagsForBlog ( BlogInfo blog, int pageIndex, int pageSize ) : IPagedCollection
GetMetaTagsForEntry ( Entry entry, int pageIndex, int pageSize ) : IPagedCollection
GetPagedBlogDomainAlias ( BlogInfo blog, int pageIndex, int pageSize ) : PagedCollection
GetPagedBlogs ( string host, int pageIndex, int pageSize, ConfigurationFlags flags ) : PagedCollection

Gets a pageable IList of BlogInfo instances.

GetPagedEntries ( PostType postType, int categoryID, int pageIndex, int pageSize ) : IPagedCollection

Returns a pageable collection of entries ordered by the id descending. This is used in the admin section.

GetPagedFeedback ( int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type ) : IPagedCollection

Gets the paged feedback.

GetPagedKeyWords ( int pageIndex, int pageSize ) : IPagedCollection
GetPagedLinks ( int categoryTypeID, int pageIndex, int pageSize, bool sortDescending ) : IPagedCollection
GetPagedReferrers ( int pageIndex, int pageSize, int entryId ) : IPagedCollection
GetPagedViewStats ( int pageIndex, int pageSize, DateTime beginDate, DateTime endDate ) : IPagedCollection
GetPostCollectionByMonth ( int month, int year ) : IList
GetPostsByCategoryArchive ( ) : IList
GetPostsByCategoryID ( int itemCount, int catID ) : IList
GetPostsByDayRange ( DateTime start, DateTime stop, PostType postType, bool activeOnly ) : IList
GetPostsByMonth ( int month, int year ) : IList
GetPostsByMonthArchive ( ) : IList
GetPostsByYearArchive ( ) : IList
GetPreviousAndNextEntries ( int entryId, PostType postType ) : IList

Returns the previous and next entry to the specified entry.

GetTopTags ( int ItemCount ) : int>.IDictionary
InsertImage ( Image _image ) : int
InsertKeyWord ( KeyWord keyWord ) : int
ListBlogGroups ( bool activeOnly ) : IList

Lists the blog groups.

LoadHostInfo ( HostInfo hostInfo ) : HostInfo

Returns the HostInfo for the Subtext installation.

SetEntryCategoryList ( int entryId, int categoryIds ) : bool
SetEntryTagList ( int entryId, IList tags ) : bool
TrackEntry ( EntryView ev ) : bool
TrackEntry ( IEnumerable evc ) : bool
Update ( Enclosure enclosure ) : bool
Update ( Entry entry ) : bool

Saves changes to the specified entry attaching the specified categories.

Update ( FeedbackItem feedbackItem ) : bool

Saves changes to the specified feedback.

Update ( MetaTag metaTag ) : bool
UpdateBlog ( BlogInfo info ) : bool
UpdateBlogAlias ( BlogAlias alias ) : bool
UpdateHost ( HostInfo host ) : bool

Updates the HostInfo instance. If the host record is not in the database, one is created. There should only be one host record.

UpdateImage ( Image image ) : bool
UpdateKeyWord ( KeyWord keyWord ) : bool
UpdateLink ( Link link ) : bool
UpdateLinkCategory ( LinkCategory lc ) : bool

Private Methods

Method Description
FormatEntry ( Entry e, bool UseKeyWords ) : bool
LoadLinkCategoryFromReader ( IDataReader reader ) : LinkCategory
LoadPagedReferrersCollection ( IDataReader reader ) : IPagedCollection

Method Details

ClearBlogContent() public method

public ClearBlogContent ( int blogId ) : void
blogId int
return void

Create() public method

public Create ( Enclosure enclosure ) : int
enclosure Subtext.Framework.Components.Enclosure
return int

Create() public method

Creates the specified entry in the back end data store attaching the specified category ids.
public Create ( Entry entry, int categoryIds ) : int
entry Subtext.Framework.Components.Entry Entry.
categoryIds int Category I ds.
return int

Create() public method

public Create ( FeedbackItem feedbackItem ) : int
feedbackItem Subtext.Framework.Components.FeedbackItem
return int

Create() public method

public Create ( MetaTag metaTag ) : int
metaTag Subtext.Framework.Components.MetaTag
return int

CreateBlog() public method

Adds the initial blog configuration. This is a convenience method for allowing a user with a freshly installed blog to immediately gain access to the admin section to edit the blog.
public CreateBlog ( string title, string userName, string password, string host, string subfolder ) : bool
title string
userName string Name of the user.
password string Password.
host string
subfolder string
return bool

CreateBlog() public method

Adds the initial blog configuration. This is a convenience method for allowing a user with a freshly installed blog to immediately gain access to the admin section to edit the blog.
public CreateBlog ( string title, string userName, string password, string host, string subfolder, int blogGroupId ) : bool
title string
userName string Name of the user.
password string Password.
host string
subfolder string
blogGroupId int
return bool

CreateBlogAlias() public method

public CreateBlogAlias ( BlogAlias alias ) : bool
alias BlogAlias
return bool

CreateLink() public method

public CreateLink ( Link link ) : int
link Subtext.Framework.Components.Link
return int

CreateLinkCategory() public method

public CreateLinkCategory ( LinkCategory lc ) : int
lc Subtext.Framework.Components.LinkCategory
return int

Delete() public method

Deletes the specified entry.
public Delete ( int entryId ) : bool
entryId int The entry id.
return bool

DeleteBlogAlias() public method

public DeleteBlogAlias ( BlogAlias alias ) : bool
alias BlogAlias
return bool

DeleteEnclosure() public method

public DeleteEnclosure ( int enclosureId ) : bool
enclosureId int
return bool

DeleteImage() public method

public DeleteImage ( int ImageID ) : bool
ImageID int
return bool

DeleteKeyWord() public method

public DeleteKeyWord ( int id ) : bool
id int
return bool

DeleteLink() public method

public DeleteLink ( int LinkID ) : bool
LinkID int
return bool

DeleteLinkCategory() public method

public DeleteLinkCategory ( int CategoryID ) : bool
CategoryID int
return bool

DeleteMetaTag() public method

public DeleteMetaTag ( int metaTagId ) : bool
metaTagId int
return bool

DestroyFeedback() public method

public DestroyFeedback ( FeedbackStatusFlag status ) : void
status FeedbackStatusFlag
return void

DestroyFeedback() public method

Completely deletes the feedback from the system.
public DestroyFeedback ( int id ) : void
id int The id.
return void

GetActiveCategories() public method

public GetActiveCategories ( ) : IList
return IList

GetBlogAliasById() public method

public GetBlogAliasById ( int aliasId ) : BlogAlias
aliasId int
return BlogAlias

GetBlogByDomainAlias() public method

public GetBlogByDomainAlias ( string host, string subfolder, bool strict ) : BlogInfo
host string
subfolder string
strict bool
return BlogInfo

GetBlogById() public method

Gets the blog by id.
public GetBlogById ( int blogId ) : BlogInfo
blogId int Blog id.
return BlogInfo

GetBlogGroup() public method

Gets the blog group.
public GetBlogGroup ( int id, bool activeOnly ) : BlogGroup
id int The id.
activeOnly bool if set to true [active only].
return Subtext.Framework.Components.BlogGroup

GetBlogInfo() public method

Returns a BlogInfo instance containing the configuration settings for the blog specified by the Hostname and Application.
Until Subtext supports multiple blogs again (if ever), this will always return the same instance.
public GetBlogInfo ( string hostname, string subfolder, bool strict ) : BlogInfo
hostname string Hostname.
subfolder string Subfolder.
strict bool If false, then this will return a blog record if /// there is only one blog record, regardless if the subfolder and hostname match.
return BlogInfo

GetBlogPosts() public method

Returns blog posts that meet the criteria specified in the PostConfig flags.
public GetBlogPosts ( int itemCount, PostConfig pc ) : IList
itemCount int Item count.
pc PostConfig Pc.
return IList

GetCategories() public method

Gets the categories for the specified category type.
public GetCategories ( CategoryType catType, bool activeOnly ) : IList
catType CategoryType Type of the cat.
activeOnly bool if set to true [active only].
return IList

GetCommentByChecksumHash() public method

Searches the data store for the first comment with a matching checksum hash.
public GetCommentByChecksumHash ( string checksumHash ) : Entry
checksumHash string Checksum hash.
return Subtext.Framework.Components.Entry

GetConditionalEntries() public method

Gets the entries that meet the specific PostType and the PostConfig flags.
This is called to get the main syndicated entries.
public GetConditionalEntries ( int itemCount, PostType postType, PostConfig postConfig, bool includeCategories ) : IList
itemCount int Item count.
postType PostType The type of post to retrieve.
postConfig PostConfig Post configuration options.
includeCategories bool Whether or not to include categories
return IList

GetEntriesByCategory() public method

public GetEntriesByCategory ( int itemCount, int catID, bool activeOnly ) : IList
itemCount int
catID int
activeOnly bool
return IList

GetEntriesByTag() public method

public GetEntriesByTag ( int itemCount, string tagName ) : IList
itemCount int
tagName string
return IList

GetEntry() public method

Returns an active Entry by the id regardless of which blog it is located in.
public GetEntry ( int id, bool includeCategories ) : Entry
id int Id of the entry
includeCategories bool Whether the entry should have its Categories property populated
return Subtext.Framework.Components.Entry

GetEntry() public method

Returns an Entry with the specified id.
public GetEntry ( int id, bool activeOnly, bool includeCategories ) : Entry
id int Id of the entry
activeOnly bool Whether or not to only return the entry if it is active.
includeCategories bool Whether the entry should have its Categories property populated
return Subtext.Framework.Components.Entry

GetEntry() public method

Returns an Entry with the specified entry name.
public GetEntry ( string entryName, bool activeOnly, bool includeCategories ) : Entry
entryName string Url friendly entry name.
activeOnly bool Whether or not to only return the entry if it is active.
includeCategories bool Whether the entry should have its Categories property populated
return Subtext.Framework.Components.Entry

GetEntryDay() public method

public GetEntryDay ( DateTime dt ) : EntryDay
dt DateTime
return EntryDay

GetFeedback() public method

Returns the feedback by id.
public GetFeedback ( int id ) : FeedbackItem
id int
return Subtext.Framework.Components.FeedbackItem

GetFeedbackCounts() public method

Gets the feedback counts for the various top level statuses.
public GetFeedbackCounts ( int &approved, int &needsModeration, int &flaggedAsSpam, int &deleted ) : void
approved int The approved.
needsModeration int The needs moderation.
flaggedAsSpam int The flagged as spam.
deleted int The deleted.
return void

GetFeedbackForEntry() public method

Returns all the active entries for the specified post.
public GetFeedbackForEntry ( Entry parentEntry ) : IList
parentEntry Subtext.Framework.Components.Entry
return IList

GetImage() public method

public GetImage ( int imageID, bool activeOnly ) : Image
imageID int
activeOnly bool
return Subtext.Framework.Components.Image

GetImagesByCategoryID() public method

public GetImagesByCategoryID ( int catID, bool activeOnly ) : ImageCollection
catID int
activeOnly bool
return ImageCollection

GetKeyWord() public method

public GetKeyWord ( int KeyWordID ) : KeyWord
KeyWordID int
return Subtext.Framework.Components.KeyWord

GetKeyWords() public method

public GetKeyWords ( ) : IList
return IList

GetLink() public method

public GetLink ( int linkID ) : Link
linkID int
return Subtext.Framework.Components.Link

GetLinkCategory() public method

Gets the link category for the specified category id.
public GetLinkCategory ( int categoryId, bool activeOnly ) : LinkCategory
categoryId int The category id.
activeOnly bool if set to true [active only].
return Subtext.Framework.Components.LinkCategory

GetLinkCategory() public method

Gets the link category for the specified category name.
public GetLinkCategory ( string categoryName, bool activeOnly ) : LinkCategory
categoryName string The category name.
activeOnly bool if set to true [active only].
return Subtext.Framework.Components.LinkCategory

GetLinkCollectionByPostID() public method

public GetLinkCollectionByPostID ( int PostID ) : IList
PostID int
return IList

GetMetaTagsForBlog() public method

public GetMetaTagsForBlog ( BlogInfo blog, int pageIndex, int pageSize ) : IPagedCollection
blog BlogInfo
pageIndex int
pageSize int
return IPagedCollection

GetMetaTagsForEntry() public method

public GetMetaTagsForEntry ( Entry entry, int pageIndex, int pageSize ) : IPagedCollection
entry Subtext.Framework.Components.Entry
pageIndex int
pageSize int
return IPagedCollection

GetPagedBlogDomainAlias() public method

public GetPagedBlogDomainAlias ( BlogInfo blog, int pageIndex, int pageSize ) : PagedCollection
blog BlogInfo
pageIndex int
pageSize int
return PagedCollection

GetPagedBlogs() public method

Gets a pageable IList of BlogInfo instances.
public GetPagedBlogs ( string host, int pageIndex, int pageSize, ConfigurationFlags flags ) : PagedCollection
host string The host filter. Set to null to return all blogs.
pageIndex int Page index.
pageSize int Size of the page.
flags ConfigurationFlags
return PagedCollection

GetPagedEntries() public method

Returns a pageable collection of entries ordered by the id descending. This is used in the admin section.
public GetPagedEntries ( PostType postType, int categoryID, int pageIndex, int pageSize ) : IPagedCollection
postType PostType Type of the post.
categoryID int The category ID.
pageIndex int Index of the page.
pageSize int Size of the page.
return IPagedCollection

GetPagedFeedback() public method

Gets the paged feedback.
public GetPagedFeedback ( int pageIndex, int pageSize, FeedbackStatusFlag status, FeedbackStatusFlag excludeStatusMask, FeedbackType type ) : IPagedCollection
pageIndex int Index of the page.
pageSize int Size of the page.
status FeedbackStatusFlag A flag for the status types to return.
excludeStatusMask FeedbackStatusFlag A flag for the statuses to exclude.
type FeedbackType The type of feedback to return.
return IPagedCollection

GetPagedKeyWords() public method

public GetPagedKeyWords ( int pageIndex, int pageSize ) : IPagedCollection
pageIndex int
pageSize int
return IPagedCollection

GetPagedLinks() public method

public GetPagedLinks ( int categoryTypeID, int pageIndex, int pageSize, bool sortDescending ) : IPagedCollection
categoryTypeID int
pageIndex int
pageSize int
sortDescending bool
return IPagedCollection

GetPagedReferrers() public method

public GetPagedReferrers ( int pageIndex, int pageSize, int entryId ) : IPagedCollection
pageIndex int
pageSize int
entryId int
return IPagedCollection

GetPagedViewStats() public method

public GetPagedViewStats ( int pageIndex, int pageSize, DateTime beginDate, DateTime endDate ) : IPagedCollection
pageIndex int
pageSize int
beginDate DateTime
endDate DateTime
return IPagedCollection

GetPostCollectionByMonth() public method

public GetPostCollectionByMonth ( int month, int year ) : IList
month int
year int
return IList

GetPostsByCategoryArchive() public method

public GetPostsByCategoryArchive ( ) : IList
return IList

GetPostsByCategoryID() public method

public GetPostsByCategoryID ( int itemCount, int catID ) : IList
itemCount int
catID int
return IList

GetPostsByDayRange() public method

public GetPostsByDayRange ( DateTime start, DateTime stop, PostType postType, bool activeOnly ) : IList
start DateTime
stop DateTime
postType PostType
activeOnly bool
return IList

GetPostsByMonth() public method

public GetPostsByMonth ( int month, int year ) : IList
month int
year int
return IList

GetPostsByMonthArchive() public method

public GetPostsByMonthArchive ( ) : IList
return IList

GetPostsByYearArchive() public method

public GetPostsByYearArchive ( ) : IList
return IList

GetPreviousAndNextEntries() public method

Returns the previous and next entry to the specified entry.
public GetPreviousAndNextEntries ( int entryId, PostType postType ) : IList
entryId int
postType PostType
return IList

GetTopTags() public method

public GetTopTags ( int ItemCount ) : int>.IDictionary
ItemCount int
return int>.IDictionary

InsertImage() public method

public InsertImage ( Image _image ) : int
_image Subtext.Framework.Components.Image
return int

InsertKeyWord() public method

public InsertKeyWord ( KeyWord keyWord ) : int
keyWord Subtext.Framework.Components.KeyWord
return int

ListBlogGroups() public method

Lists the blog groups.
public ListBlogGroups ( bool activeOnly ) : IList
activeOnly bool if set to true [active only].
return IList

LoadHostInfo() public method

Returns the HostInfo for the Subtext installation.
public LoadHostInfo ( HostInfo hostInfo ) : HostInfo
hostInfo HostInfo
return HostInfo

SetEntryCategoryList() public method

public SetEntryCategoryList ( int entryId, int categoryIds ) : bool
entryId int
categoryIds int
return bool

SetEntryTagList() public method

public SetEntryTagList ( int entryId, IList tags ) : bool
entryId int
tags IList
return bool

TrackEntry() public method

public TrackEntry ( EntryView ev ) : bool
ev Subtext.Framework.Components.EntryView
return bool

TrackEntry() public method

public TrackEntry ( IEnumerable evc ) : bool
evc IEnumerable
return bool

Update() public method

public Update ( Enclosure enclosure ) : bool
enclosure Subtext.Framework.Components.Enclosure
return bool

Update() public method

Saves changes to the specified entry attaching the specified categories.
public Update ( Entry entry ) : bool
entry Subtext.Framework.Components.Entry Entry.
return bool

Update() public method

Saves changes to the specified feedback.
public Update ( FeedbackItem feedbackItem ) : bool
feedbackItem Subtext.Framework.Components.FeedbackItem The feedback item.
return bool

Update() public method

public Update ( MetaTag metaTag ) : bool
metaTag Subtext.Framework.Components.MetaTag
return bool

UpdateBlog() public method

public UpdateBlog ( BlogInfo info ) : bool
info BlogInfo
return bool

UpdateBlogAlias() public method

public UpdateBlogAlias ( BlogAlias alias ) : bool
alias BlogAlias
return bool

UpdateHost() public method

Updates the HostInfo instance. If the host record is not in the database, one is created. There should only be one host record.
public UpdateHost ( HostInfo host ) : bool
host HostInfo The host information.
return bool

UpdateImage() public method

public UpdateImage ( Image image ) : bool
image Subtext.Framework.Components.Image
return bool

UpdateKeyWord() public method

public UpdateKeyWord ( KeyWord keyWord ) : bool
keyWord Subtext.Framework.Components.KeyWord
return bool

UpdateLink() public method

public UpdateLink ( Link link ) : bool
link Subtext.Framework.Components.Link
return bool

UpdateLinkCategory() public method

public UpdateLinkCategory ( LinkCategory lc ) : bool
lc Subtext.Framework.Components.LinkCategory
return bool