C# Class Subtext.Framework.Entries

Static class used to get entries (blog posts, comments, etc...) from the data store.
Datei anzeigen Open project: ayende/Subtext

Public Methods

Method Description
AutoGenerateFriendlyUrl ( string title ) : string

Converts a title of a blog post into a friendly, but URL safe string. Defaults entryId to 0 as if it was a new entry

AutoGenerateFriendlyUrl ( string title, char wordSeparator ) : string

Converts a title of a blog post into a friendly, but URL safe string. Defaults entryId to 0 as if it was a new entry

AutoGenerateFriendlyUrl ( string title, char wordSeparator, TextTransform textTransform ) : string

Converts a title of a blog post into a friendly, but URL safe string. Defaults entryId to 0 as if it was a new entry

AutoGenerateFriendlyUrl ( string title, char wordSeparator, int entryId, TextTransform textTransform ) : string

Converts a title of a blog post into a friendly, but URL safe string.

AutoGenerateFriendlyUrl ( string title, int entryId ) : string

Converts a title of a blog post into a friendly, but URL safe string.

Create ( Entry entry ) : int

Creates the specified entry and returns its ID.

Delete ( int entryId ) : bool

Deletes the entry with the specified entryId.

GetBlogPosts ( int itemCount, PostConfig pc ) : IList

Gets the specified number of entries using the PostConfig flags specified.

This is used to get the posts displayed on the home page.

GetCategoryIdsFromCategoryTitles ( Entry entry ) : int[]
GetCommentByChecksumHash ( string checksumHash ) : Entry

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

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

Gets the entry from the data store by id. Only returns an entry if it is within the current blog (Config.CurrentBlog).

GetEntry ( int entryId, bool includeCategories ) : Entry

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

GetEntry ( string EntryName, PostConfig postConfig, bool includeCategories ) : Entry

Gets the entry from the data store by entry name. Only returns an entry if it is within the current blog (Config.CurrentBlog).

GetFeedBack ( Entry parentEntry ) : IList

Gets the comments (including trackback, etc...) for the specified entry.

GetHomePageEntries ( int itemCount ) : IList

Gets the entries to display on the home page.

GetMainSyndicationEntries ( int itemCount ) : IList

Gets the main syndicated entries.

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

Returns a collection of Posts for a give page and index size.

GetPostCollectionByMonth ( int month, int year ) : IList
GetPostsByCategoryID ( int itemCount, int catID ) : IList
GetPostsByDayRange ( System.DateTime start, System.DateTime stop, PostType postType, bool activeOnly ) : IList
GetPostsByMonth ( int month, int year ) : IList
GetRecentPosts ( int itemCount, PostType postType, PostConfig postConfig, bool includeCategories ) : IList

Returns the itemCount most recent posts. This is used to support MetaBlogAPI...

GetSingleDay ( System.DateTime dt ) : EntryDay
RebuildAllTags ( ) : bool
SetEntryCategoryList ( int entryId ) : void

Sets the categories for this entry.

Update ( Entry entry ) : void

Updates the specified entry in the data provider.

Private Methods

Method Description
RemoveNonWordCharacters ( string text ) : string
RemoveTrailingPeriods ( string text ) : string
ReplaceSpacesWithSeparator ( string text, char wordSeparator ) : string
ReplaceUnicodeCharacters ( string text ) : string

Method Details

AutoGenerateFriendlyUrl() public static method

Converts a title of a blog post into a friendly, but URL safe string. Defaults entryId to 0 as if it was a new entry
public static AutoGenerateFriendlyUrl ( string title ) : string
title string The original title of the blog post.
return string

AutoGenerateFriendlyUrl() public static method

Converts a title of a blog post into a friendly, but URL safe string. Defaults entryId to 0 as if it was a new entry
public static AutoGenerateFriendlyUrl ( string title, char wordSeparator ) : string
title string The original title of the blog post.
wordSeparator char The string used to separate words in the title.
return string

AutoGenerateFriendlyUrl() public static method

Converts a title of a blog post into a friendly, but URL safe string. Defaults entryId to 0 as if it was a new entry
public static AutoGenerateFriendlyUrl ( string title, char wordSeparator, TextTransform textTransform ) : string
title string The original title of the blog post.
wordSeparator char The string used to separate words in the title.
textTransform TextTransform Used to specify a change to the casing of the string.
return string

AutoGenerateFriendlyUrl() public static method

Converts a title of a blog post into a friendly, but URL safe string.
public static AutoGenerateFriendlyUrl ( string title, char wordSeparator, int entryId, TextTransform textTransform ) : string
title string The original title of the blog post.
wordSeparator char The string used to separate words in the title.
entryId int The id of the current entry.
textTransform TextTransform Used to specify a change to the casing of the string.
return string

AutoGenerateFriendlyUrl() public static method

Converts a title of a blog post into a friendly, but URL safe string.
public static AutoGenerateFriendlyUrl ( string title, int entryId ) : string
title string The original title of the blog post.
entryId int The id of the current entry.
return string

Create() public static method

Creates the specified entry and returns its ID.
public static Create ( Entry entry ) : int
entry Subtext.Framework.Components.Entry Entry.
return int

Delete() public static method

Deletes the entry with the specified entryId.
public static Delete ( int entryId ) : bool
entryId int
return bool

GetBlogPosts() public static method

Gets the specified number of entries using the PostConfig flags specified.
This is used to get the posts displayed on the home page.
public static GetBlogPosts ( int itemCount, PostConfig pc ) : IList
itemCount int Item count.
pc PostConfig Pc.
return IList

GetCategoryIdsFromCategoryTitles() public static method

public static GetCategoryIdsFromCategoryTitles ( Entry entry ) : int[]
entry Subtext.Framework.Components.Entry
return int[]

GetCommentByChecksumHash() public static method

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

GetEntriesByCategory() public static method

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

GetEntriesByTag() public static method

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

GetEntry() public static method

Gets the entry from the data store by id. Only returns an entry if it is within the current blog (Config.CurrentBlog).
public static GetEntry ( int entryId, PostConfig postConfig, bool includeCategories ) : Entry
entryId int The ID of the entry.
postConfig PostConfig The entry option used to constrain the search.
includeCategories bool Whether the returned entry should have its categories collection populated.
return Subtext.Framework.Components.Entry

GetEntry() public static method

Returns an active entry by the id regardless of which blog it is located in.
public static GetEntry ( int entryId, bool includeCategories ) : Entry
entryId int The ID of the entry.
includeCategories bool Whether the returned entry should have its categories collection populated.
return Subtext.Framework.Components.Entry

GetEntry() public static method

Gets the entry from the data store by entry name. Only returns an entry if it is within the current blog (Config.CurrentBlog).
public static GetEntry ( string EntryName, PostConfig postConfig, bool includeCategories ) : Entry
EntryName string Name of the entry.
postConfig PostConfig The entry option used to constrain the search.
includeCategories bool Whether the returned entry should have its categories collection populated.
return Subtext.Framework.Components.Entry

GetFeedBack() public static method

Gets the comments (including trackback, etc...) for the specified entry.
public static GetFeedBack ( Entry parentEntry ) : IList
parentEntry Subtext.Framework.Components.Entry Parent entry.
return IList

GetHomePageEntries() public static method

Gets the entries to display on the home page.
public static GetHomePageEntries ( int itemCount ) : IList
itemCount int Item count.
return IList

GetMainSyndicationEntries() public static method

Gets the main syndicated entries.
public static GetMainSyndicationEntries ( int itemCount ) : IList
itemCount int Item count.
return IList

GetPagedEntries() public static method

Returns a collection of Posts for a give page and index size.
public static GetPagedEntries ( PostType postType, int categoryID, int pageIndex, int pageSize ) : IPagedCollection
postType PostType
categoryID int -1 means not to filter by a categoryID
pageIndex int
pageSize int
return IPagedCollection

GetPostCollectionByMonth() public static method

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

GetPostsByCategoryID() public static method

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

GetPostsByDayRange() public static method

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

GetPostsByMonth() public static method

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

GetRecentPosts() public static method

Returns the itemCount most recent posts. This is used to support MetaBlogAPI...
public static GetRecentPosts ( int itemCount, PostType postType, PostConfig postConfig, bool includeCategories ) : IList
itemCount int
postType PostType
postConfig PostConfig
includeCategories bool
return IList

GetSingleDay() public static method

public static GetSingleDay ( System.DateTime dt ) : EntryDay
dt System.DateTime
return EntryDay

RebuildAllTags() public static method

public static RebuildAllTags ( ) : bool
return bool

SetEntryCategoryList() public static method

Sets the categories for this entry.
public static SetEntryCategoryList ( int entryId ) : void
entryId int The entry id.
return void

Update() public static method

Updates the specified entry in the data provider.
public static Update ( Entry entry ) : void
entry Subtext.Framework.Components.Entry Entry.
return void