C# Class Subtext.Framework.Data.DatabaseObjectProvider

Afficher le fichier Open project: ayende/Subtext Class Usage Examples

Méthodes publiques

Méthode 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

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

Method Details

ClearBlogContent() public méthode

public ClearBlogContent ( int blogId ) : void
blogId int
Résultat void

Create() public méthode

public Create ( Enclosure enclosure ) : int
enclosure Subtext.Framework.Components.Enclosure
Résultat int

Create() public méthode

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.
Résultat int

Create() public méthode

public Create ( FeedbackItem feedbackItem ) : int
feedbackItem Subtext.Framework.Components.FeedbackItem
Résultat int

Create() public méthode

public Create ( MetaTag metaTag ) : int
metaTag Subtext.Framework.Components.MetaTag
Résultat int

CreateBlog() public méthode

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
Résultat bool

CreateBlog() public méthode

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
Résultat bool

CreateBlogAlias() public méthode

public CreateBlogAlias ( BlogAlias alias ) : bool
alias BlogAlias
Résultat bool

CreateLink() public méthode

public CreateLink ( Link link ) : int
link Subtext.Framework.Components.Link
Résultat int

CreateLinkCategory() public méthode

public CreateLinkCategory ( LinkCategory lc ) : int
lc Subtext.Framework.Components.LinkCategory
Résultat int

Delete() public méthode

Deletes the specified entry.
public Delete ( int entryId ) : bool
entryId int The entry id.
Résultat bool

DeleteBlogAlias() public méthode

public DeleteBlogAlias ( BlogAlias alias ) : bool
alias BlogAlias
Résultat bool

DeleteEnclosure() public méthode

public DeleteEnclosure ( int enclosureId ) : bool
enclosureId int
Résultat bool

DeleteImage() public méthode

public DeleteImage ( int ImageID ) : bool
ImageID int
Résultat bool

DeleteKeyWord() public méthode

public DeleteKeyWord ( int id ) : bool
id int
Résultat bool

DeleteLink() public méthode

public DeleteLink ( int LinkID ) : bool
LinkID int
Résultat bool

DeleteLinkCategory() public méthode

public DeleteLinkCategory ( int CategoryID ) : bool
CategoryID int
Résultat bool

DeleteMetaTag() public méthode

public DeleteMetaTag ( int metaTagId ) : bool
metaTagId int
Résultat bool

DestroyFeedback() public méthode

public DestroyFeedback ( FeedbackStatusFlag status ) : void
status FeedbackStatusFlag
Résultat void

DestroyFeedback() public méthode

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

GetActiveCategories() public méthode

public GetActiveCategories ( ) : IList
Résultat IList

GetBlogAliasById() public méthode

public GetBlogAliasById ( int aliasId ) : BlogAlias
aliasId int
Résultat BlogAlias

GetBlogByDomainAlias() public méthode

public GetBlogByDomainAlias ( string host, string subfolder, bool strict ) : BlogInfo
host string
subfolder string
strict bool
Résultat BlogInfo

GetBlogById() public méthode

Gets the blog by id.
public GetBlogById ( int blogId ) : BlogInfo
blogId int Blog id.
Résultat BlogInfo

GetBlogGroup() public méthode

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

GetBlogInfo() public méthode

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.
Résultat BlogInfo

GetBlogPosts() public méthode

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.
Résultat IList

GetCategories() public méthode

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].
Résultat IList

GetCommentByChecksumHash() public méthode

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

GetConditionalEntries() public méthode

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
Résultat IList

GetEntriesByCategory() public méthode

public GetEntriesByCategory ( int itemCount, int catID, bool activeOnly ) : IList
itemCount int
catID int
activeOnly bool
Résultat IList

GetEntriesByTag() public méthode

public GetEntriesByTag ( int itemCount, string tagName ) : IList
itemCount int
tagName string
Résultat IList

GetEntry() public méthode

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
Résultat Subtext.Framework.Components.Entry

GetEntry() public méthode

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
Résultat Subtext.Framework.Components.Entry

GetEntry() public méthode

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
Résultat Subtext.Framework.Components.Entry

GetEntryDay() public méthode

public GetEntryDay ( DateTime dt ) : EntryDay
dt DateTime
Résultat EntryDay

GetFeedback() public méthode

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

GetFeedbackCounts() public méthode

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.
Résultat void

GetFeedbackForEntry() public méthode

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

GetImage() public méthode

public GetImage ( int imageID, bool activeOnly ) : Image
imageID int
activeOnly bool
Résultat Subtext.Framework.Components.Image

GetImagesByCategoryID() public méthode

public GetImagesByCategoryID ( int catID, bool activeOnly ) : ImageCollection
catID int
activeOnly bool
Résultat ImageCollection

GetKeyWord() public méthode

public GetKeyWord ( int KeyWordID ) : KeyWord
KeyWordID int
Résultat Subtext.Framework.Components.KeyWord

GetKeyWords() public méthode

public GetKeyWords ( ) : IList
Résultat IList

GetLink() public méthode

public GetLink ( int linkID ) : Link
linkID int
Résultat Subtext.Framework.Components.Link

GetLinkCategory() public méthode

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].
Résultat Subtext.Framework.Components.LinkCategory

GetLinkCategory() public méthode

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].
Résultat Subtext.Framework.Components.LinkCategory

GetLinkCollectionByPostID() public méthode

public GetLinkCollectionByPostID ( int PostID ) : IList
PostID int
Résultat IList

GetMetaTagsForBlog() public méthode

public GetMetaTagsForBlog ( BlogInfo blog, int pageIndex, int pageSize ) : IPagedCollection
blog BlogInfo
pageIndex int
pageSize int
Résultat IPagedCollection

GetMetaTagsForEntry() public méthode

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

GetPagedBlogDomainAlias() public méthode

public GetPagedBlogDomainAlias ( BlogInfo blog, int pageIndex, int pageSize ) : PagedCollection
blog BlogInfo
pageIndex int
pageSize int
Résultat PagedCollection

GetPagedBlogs() public méthode

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
Résultat PagedCollection

GetPagedEntries() public méthode

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.
Résultat IPagedCollection

GetPagedFeedback() public méthode

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.
Résultat IPagedCollection

GetPagedKeyWords() public méthode

public GetPagedKeyWords ( int pageIndex, int pageSize ) : IPagedCollection
pageIndex int
pageSize int
Résultat IPagedCollection

GetPagedLinks() public méthode

public GetPagedLinks ( int categoryTypeID, int pageIndex, int pageSize, bool sortDescending ) : IPagedCollection
categoryTypeID int
pageIndex int
pageSize int
sortDescending bool
Résultat IPagedCollection

GetPagedReferrers() public méthode

public GetPagedReferrers ( int pageIndex, int pageSize, int entryId ) : IPagedCollection
pageIndex int
pageSize int
entryId int
Résultat IPagedCollection

GetPagedViewStats() public méthode

public GetPagedViewStats ( int pageIndex, int pageSize, DateTime beginDate, DateTime endDate ) : IPagedCollection
pageIndex int
pageSize int
beginDate DateTime
endDate DateTime
Résultat IPagedCollection

GetPostCollectionByMonth() public méthode

public GetPostCollectionByMonth ( int month, int year ) : IList
month int
year int
Résultat IList

GetPostsByCategoryArchive() public méthode

public GetPostsByCategoryArchive ( ) : IList
Résultat IList

GetPostsByCategoryID() public méthode

public GetPostsByCategoryID ( int itemCount, int catID ) : IList
itemCount int
catID int
Résultat IList

GetPostsByDayRange() public méthode

public GetPostsByDayRange ( DateTime start, DateTime stop, PostType postType, bool activeOnly ) : IList
start DateTime
stop DateTime
postType PostType
activeOnly bool
Résultat IList

GetPostsByMonth() public méthode

public GetPostsByMonth ( int month, int year ) : IList
month int
year int
Résultat IList

GetPostsByMonthArchive() public méthode

public GetPostsByMonthArchive ( ) : IList
Résultat IList

GetPostsByYearArchive() public méthode

public GetPostsByYearArchive ( ) : IList
Résultat IList

GetPreviousAndNextEntries() public méthode

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

GetTopTags() public méthode

public GetTopTags ( int ItemCount ) : int>.IDictionary
ItemCount int
Résultat int>.IDictionary

InsertImage() public méthode

public InsertImage ( Image _image ) : int
_image Subtext.Framework.Components.Image
Résultat int

InsertKeyWord() public méthode

public InsertKeyWord ( KeyWord keyWord ) : int
keyWord Subtext.Framework.Components.KeyWord
Résultat int

ListBlogGroups() public méthode

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

LoadHostInfo() public méthode

Returns the HostInfo for the Subtext installation.
public LoadHostInfo ( HostInfo hostInfo ) : HostInfo
hostInfo HostInfo
Résultat HostInfo

SetEntryCategoryList() public méthode

public SetEntryCategoryList ( int entryId, int categoryIds ) : bool
entryId int
categoryIds int
Résultat bool

SetEntryTagList() public méthode

public SetEntryTagList ( int entryId, IList tags ) : bool
entryId int
tags IList
Résultat bool

TrackEntry() public méthode

public TrackEntry ( EntryView ev ) : bool
ev Subtext.Framework.Components.EntryView
Résultat bool

TrackEntry() public méthode

public TrackEntry ( IEnumerable evc ) : bool
evc IEnumerable
Résultat bool

Update() public méthode

public Update ( Enclosure enclosure ) : bool
enclosure Subtext.Framework.Components.Enclosure
Résultat bool

Update() public méthode

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

Update() public méthode

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

Update() public méthode

public Update ( MetaTag metaTag ) : bool
metaTag Subtext.Framework.Components.MetaTag
Résultat bool

UpdateBlog() public méthode

public UpdateBlog ( BlogInfo info ) : bool
info BlogInfo
Résultat bool

UpdateBlogAlias() public méthode

public UpdateBlogAlias ( BlogAlias alias ) : bool
alias BlogAlias
Résultat bool

UpdateHost() public méthode

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.
Résultat bool

UpdateImage() public méthode

public UpdateImage ( Image image ) : bool
image Subtext.Framework.Components.Image
Résultat bool

UpdateKeyWord() public méthode

public UpdateKeyWord ( KeyWord keyWord ) : bool
keyWord Subtext.Framework.Components.KeyWord
Résultat bool

UpdateLink() public méthode

public UpdateLink ( Link link ) : bool
link Subtext.Framework.Components.Link
Résultat bool

UpdateLinkCategory() public méthode

public UpdateLinkCategory ( LinkCategory lc ) : bool
lc Subtext.Framework.Components.LinkCategory
Résultat bool