C# 클래스 ScrewTurn.Wiki.PagesStorageProvider

Implements a Pages Storage Provider.
상속: IPagesStorageProviderV30
파일 보기 프로젝트 열기: mono/ScrewTurnWiki 1 사용 예제들

공개 메소드들

메소드 설명
AddCategory ( string nspace, string name ) : CategoryInfo

Adds a new Category.

AddContentTemplate ( string name, string content ) : ContentTemplate

Adds a new content template.

AddMessage ( System.PageInfo page, string username, string subject, System.DateTime dateTime, string body, int parent ) : bool

Adds a new Message to a Page.

AddNamespace ( string name ) : NamespaceInfo

Adds a new namespace.

AddNavigationPath ( string nspace, string name, System.PageInfo pages ) : NavigationPath

Adds a new Navigation Path.

AddPage ( string nspace, string name, System.DateTime creationDateTime ) : System.PageInfo

Adds a Page.

This method should not create the content of the Page.

AddSnippet ( string name, string content ) : System.Snippet

Adds a new Snippet.

BulkStoreMessages ( System.PageInfo page, Message messages ) : bool

Removes all messages for a page and stores the new messages.

DeleteBackups ( System.PageInfo page, int revision ) : bool

Deletes the Backups of a Page, up to a specified revision.

DeleteDraft ( System.PageInfo page ) : bool

Deletes a draft of a Page.

GetBackupContent ( System.PageInfo page, int revision ) : PageContent

Gets the Content of a Backup.

GetBackups ( System.PageInfo page ) : int[]

Gets the Backup/Revision numbers of a Page.

GetCategories ( NamespaceInfo nspace ) : CategoryInfo[]

Gets all the Categories in a namespace.

GetCategoriesForPage ( System.PageInfo page ) : CategoryInfo[]

Gets all the categories of a page.

GetCategory ( string fullName ) : CategoryInfo

Gets a category.

GetContent ( System.PageInfo page ) : PageContent

Gets the Content of a Page.

GetContentTemplates ( ) : ContentTemplate[]

Gets all the content templates.

GetDraft ( System.PageInfo page ) : PageContent

Gets the content of a draft of a Page.

GetIndexStats ( int &documentCount, int &wordCount, int &occurrenceCount, long &size ) : void

Gets some statistics about the search engine index.

GetMessageCount ( System.PageInfo page ) : int

Gets the total number of Messages in a Page Discussion.

GetMessages ( System.PageInfo page ) : System.Globalization.Message[]

Gets the Page Messages.

GetNamespace ( string name ) : NamespaceInfo

Gets a namespace.

GetNamespaces ( ) : NamespaceInfo[]

Gets all the sub-namespaces.

GetNavigationPaths ( NamespaceInfo nspace ) : NavigationPath[]

Gets all the Navigation Paths in a Namespace.

GetPage ( string fullName ) : System.PageInfo

Gets a page.

GetPages ( NamespaceInfo nspace ) : System.PageInfo[]

Gets all the Pages in a namespace.

GetSnippets ( ) : System.Snippet[]

Gets all the Snippets.

GetUncategorizedPages ( NamespaceInfo nspace ) : System.PageInfo[]

Gets all the pages in a namespace that are bound to zero categories.

Init ( IHostV30 host, string config ) : void

Initializes the Provider.

MergeCategories ( CategoryInfo source, CategoryInfo destination ) : CategoryInfo

Merges two Categories.

The destination Category remains, while the source Category is deleted, and all its Pages re-bound in the destination Category.

ModifyContentTemplate ( string name, string content ) : ContentTemplate

Modifies an existing content template.

ModifyMessage ( System.PageInfo page, int id, string username, string subject, System.DateTime dateTime, string body ) : bool

Modifies a Message.

ModifyNavigationPath ( NavigationPath path, System.PageInfo pages ) : NavigationPath

Modifies an existing Navigation Path.

ModifyPage ( System.PageInfo page, string title, string username, System.DateTime dateTime, string comment, string content, string keywords, string description, SaveMode saveMode ) : bool

Modifies the Content of a Page.

If saveMode equals Draft and a draft already exists, it is overwritten.

ModifySnippet ( string name, string content ) : System.Snippet

Modifies a new Snippet.

MovePage ( System.PageInfo page, NamespaceInfo destination, bool copyCategories ) : System.PageInfo

Moves a page from its namespace into another.

PerformSearch ( SearchParameters parameters ) : SearchResultCollection

Performs a search in the index.

RebindPage ( System.PageInfo page, string categories ) : bool

Binds a Page with one or more Categories.

After a successful operation, the Page is bound with all and only the categories passed as argument.

RebuildIndex ( ) : void

Rebuilds the search index.

RemoveCategory ( CategoryInfo category ) : bool

Removes a Category.

RemoveContentTemplate ( string name ) : bool

Removes a content template.

RemoveMessage ( System.PageInfo page, int id, bool removeReplies ) : bool

Removes a Message.

RemoveNamespace ( NamespaceInfo nspace ) : bool

Removes a namespace.

RemoveNavigationPath ( NavigationPath path ) : bool

Removes a Navigation Path.

RemovePage ( System.PageInfo page ) : bool

Removes a Page.

RemoveSnippet ( string name ) : bool

Removes a new Snippet.

RenameCategory ( CategoryInfo category, string newName ) : CategoryInfo

Renames a Category.

RenameNamespace ( NamespaceInfo nspace, string newName ) : NamespaceInfo

Renames a namespace.

RenamePage ( System.PageInfo page, string newName ) : System.PageInfo

Renames a Page.

RollbackPage ( System.PageInfo page, int revision ) : bool

Performs the rollback of a Page to a specified revision.

SetBackupContent ( PageContent content, int revision ) : bool

Forces to overwrite or create a Backup.

SetNamespaceDefaultPage ( NamespaceInfo nspace, System.PageInfo page ) : NamespaceInfo

Sets the default page of a namespace.

Shutdown ( ) : void

Method invoked on shutdown.

This method might not be invoked in some cases.

비공개 메소드들

메소드 설명
AddAllIds ( byte>.Dictionary dictionary, Message msg ) : void
AppendMessages ( IEnumerable messages, int parent, StringBuilder sb ) : void

Appends to a StringBuilder object the branches and leaves of a Message tree.

The methods appends the Messages traversing the tree depht-first, and it is recursive.

Backup ( System.PageInfo page ) : bool

Backups a Page.

BackupCategoriesFile ( ) : void

Makes a backup copy of the categories file.

BackupPagesFile ( ) : void

Makes a backup copy of the pages file.

BuildCategoryInfo ( string fileLine ) : CategoryInfo

Extracts an instance of T:CategoryInfo from a line contained in the categories file.

BuildDocumentHandler ( DumpedDocument dumpedDocument ) : IDocument

Handles the construction of an T:IDocument for the search engine.

BuildLocalPageInfo ( string fileLine ) : LocalPageInfo

Extracts an instance of T:LocalPageInfo from a line of the pages file.

BuildNavigationPath ( string fileLine ) : NavigationPath

Extracts an instance of T:NavigationPath from a line in the navigation paths file.

CategoryExists ( CategoryInfo category ) : bool

Determines whether a category exists.

DumpCategories ( CategoryInfo categories ) : void

Writes all categories in the storage file.

DumpMessages ( System.PageInfo page, IEnumerable messages ) : void

Dumps the Message tree of a Page to disk.

DumpNamespaces ( NamespaceInfo namespaces ) : void

Dumps namespaces on disk.

DumpNavigationPaths ( NavigationPath paths ) : void

Writes an array of Navigation Paths to disk.

DumpPages ( System.PageInfo pages ) : void

Writes all pages in the storage file.

ExtractContent ( string data, System.PageInfo pageInfo ) : PageContent
FindAnchestor ( IEnumerable messages, int id ) : Message

Finds the anchestor/parent of a Message.

FindMessage ( IEnumerable messages, int id ) : Message

Finds a Message in a Message tree.

The method is recursive.

FindNamespace ( string name, NamespaceInfo namespaces ) : NamespaceInfo

Finds a namespace.

FindPage ( string nspace, string name, System.PageInfo pages ) : System.PageInfo

Finds a page.

GetAllCategories ( ) : CategoryInfo[]

Gets all the Categories.

GetAllNavigationPaths ( ) : NavigationPath[]

Gets all the Navigation Paths.

GetAllPages ( ) : System.PageInfo[]

Gets all the Pages.

GetDraftFullPath ( LocalPageInfo page ) : string
GetFreeMessageID ( LocalPageInfo page ) : int

Find a free Message ID for a Page.

GetFullPath ( string filename ) : string
GetFullPathForContentTemplate ( string filename ) : string
GetFullPathForMessages ( string filename ) : string
GetFullPathForPageContent ( string filename ) : string
GetFullPathForPageDrafts ( string filename ) : string
GetFullPathForSnippets ( string filename ) : string
GetIndex ( List pages, string page ) : int
GetNamespacePartialPathForPageContent ( string nspace ) : string

Gets the partial path of the folder that contains page content files for the specified namespace, followed by a directory separator char if appropriate.

IndexMessage ( System.PageInfo page, int id, string subject, System.DateTime dateTime, string body ) : int

Indexes a message.

IndexMessageTree ( System.PageInfo page, Message root ) : void

Indexes a message tree.

IndexPage ( PageContent content ) : int

Indexes a page.

LoadLocalPageInfo ( System.PageInfo page ) : LocalPageInfo

Finds a corresponding instance of T:LocalPageInfo in the available pages.

MoveBackups ( System.PageInfo page, NamespaceInfo destination ) : void

Moves the backups of a page into a new namespace.

This method should be invoked before moving the corresponding page.

NamespaceExists ( string name ) : bool

Determines whether a namespace exists.

PageExists ( System.PageInfo page ) : bool

Determines whether a page exists.

RemoveMessage ( List messages, Message msg ) : bool

Removes a Message from a Message Tree.

RenameBackups ( System.PageInfo page, string newName ) : void

Renames the backups of a page.

This method should be invoked before renaming the corresponding page.

TokenizeContent ( string content ) : WordInfo[]

Tokenizes page content.

UnindexMessage ( System.PageInfo page, int id, string subject, System.DateTime dateTime, string body ) : void

Removes a message from the search engine index.

UnindexMessageTree ( System.PageInfo page, Message root ) : void

Removes a message tree from the search engine index.

UnindexPage ( PageContent content ) : void

Removes a page from the search engine index.

VerifyAndPerformUpgradeForCategories ( ) : void

Verifies the need for a data upgrade, and performs it when needed.

VerifyAndPerformUpgradeForNavigationPaths ( ) : void

Verifies the need for a data upgrade, and performs it when needed.

VerifyAndPerformUpgradeForPages ( ) : void

Verifies the need for a data upgrade, and performs it when needed.

VerifyIfPagesFileNeedsAnUpgrade ( ) : bool

Verifies whether the pages files needs to be upgraded.

메소드 상세

AddCategory() 공개 메소드

Adds a new Category.
If is null. If is empty.
public AddCategory ( string nspace, string name ) : CategoryInfo
nspace string The target namespace (null for the root).
name string The Category name.
리턴 CategoryInfo

AddContentTemplate() 공개 메소드

Adds a new content template.
If or are null. If is empty.
public AddContentTemplate ( string name, string content ) : ContentTemplate
name string The name of template.
content string The content of the template.
리턴 ContentTemplate

AddMessage() 공개 메소드

Adds a new Message to a Page.
If , , or are null. If or are empty. If is less than -1.
public AddMessage ( System.PageInfo page, string username, string subject, System.DateTime dateTime, string body, int parent ) : bool
page System.PageInfo The Page.
username string The Username.
subject string The Subject.
dateTime System.DateTime The Date/Time.
body string The Body.
parent int The Parent Message ID, or -1.
리턴 bool

AddNamespace() 공개 메소드

Adds a new namespace.
If name is null. If name is empty.
public AddNamespace ( string name ) : NamespaceInfo
name string The name of the namespace.
리턴 NamespaceInfo

AddNavigationPath() 공개 메소드

Adds a new Navigation Path.
If or are null. If or are empty.
public AddNavigationPath ( string nspace, string name, System.PageInfo pages ) : NavigationPath
nspace string The target namespace (null for the root).
name string The Name of the Path.
pages System.PageInfo The Pages array.
리턴 NavigationPath

AddPage() 공개 메소드

Adds a Page.
This method should not create the content of the Page.
If is null. If is empty.
public AddPage ( string nspace, string name, System.DateTime creationDateTime ) : System.PageInfo
nspace string The target namespace (null for the root).
name string The Page Name.
creationDateTime System.DateTime The creation Date/Time.
리턴 System.PageInfo

AddSnippet() 공개 메소드

Adds a new Snippet.
If or are null. If is empty.
public AddSnippet ( string name, string content ) : System.Snippet
name string The Name of the Snippet.
content string The Content of the Snippet.
리턴 System.Snippet

BulkStoreMessages() 공개 메소드

Removes all messages for a page and stores the new messages.
If or are null.
public BulkStoreMessages ( System.PageInfo page, Message messages ) : bool
page System.PageInfo The page.
messages System.Globalization.Message The new messages to store.
리턴 bool

DeleteBackups() 공개 메소드

Deletes the Backups of a Page, up to a specified revision.
If is null. If is less than -1.
public DeleteBackups ( System.PageInfo page, int revision ) : bool
page System.PageInfo The Page to delete the backups of.
revision int The newest revision to delete (newer revision are kept) or -1 to delete all the Backups.
리턴 bool

DeleteDraft() 공개 메소드

Deletes a draft of a Page.
If is null.
public DeleteDraft ( System.PageInfo page ) : bool
page System.PageInfo The page.
리턴 bool

GetBackupContent() 공개 메소드

Gets the Content of a Backup.
If is null. If is less than zero.
public GetBackupContent ( System.PageInfo page, int revision ) : PageContent
page System.PageInfo The Page.
revision int The revision.
리턴 ScrewTurn.Wiki.PluginFramework.PageContent

GetBackups() 공개 메소드

Gets the Backup/Revision numbers of a Page.
If is null.
public GetBackups ( System.PageInfo page ) : int[]
page System.PageInfo The Page to get the Backups of.
리턴 int[]

GetCategories() 공개 메소드

Gets all the Categories in a namespace.
public GetCategories ( NamespaceInfo nspace ) : CategoryInfo[]
nspace NamespaceInfo The namespace.
리턴 CategoryInfo[]

GetCategoriesForPage() 공개 메소드

Gets all the categories of a page.
If is null.
public GetCategoriesForPage ( System.PageInfo page ) : CategoryInfo[]
page System.PageInfo The page.
리턴 CategoryInfo[]

GetCategory() 공개 메소드

Gets a category.
If is null. If is empty.
public GetCategory ( string fullName ) : CategoryInfo
fullName string The full name of the category.
리턴 CategoryInfo

GetContent() 공개 메소드

Gets the Content of a Page.
public GetContent ( System.PageInfo page ) : PageContent
page System.PageInfo The Page.
리턴 ScrewTurn.Wiki.PluginFramework.PageContent

GetContentTemplates() 공개 메소드

Gets all the content templates.
public GetContentTemplates ( ) : ContentTemplate[]
리턴 ContentTemplate[]

GetDraft() 공개 메소드

Gets the content of a draft of a Page.
If is null.
public GetDraft ( System.PageInfo page ) : PageContent
page System.PageInfo The Page.
리턴 ScrewTurn.Wiki.PluginFramework.PageContent

GetIndexStats() 공개 메소드

Gets some statistics about the search engine index.
public GetIndexStats ( int &documentCount, int &wordCount, int &occurrenceCount, long &size ) : void
documentCount int The total number of documents.
wordCount int The total number of unique words.
occurrenceCount int The total number of word-document occurrences.
size long The approximated size, in bytes, of the search engine index.
리턴 void

GetMessageCount() 공개 메소드

Gets the total number of Messages in a Page Discussion.
If is null.
public GetMessageCount ( System.PageInfo page ) : int
page System.PageInfo The Page.
리턴 int

GetMessages() 공개 메소드

Gets the Page Messages.
If is null.
public GetMessages ( System.PageInfo page ) : System.Globalization.Message[]
page System.PageInfo The Page.
리턴 System.Globalization.Message[]

GetNamespace() 공개 메소드

Gets a namespace.
If name is null. If name is empty.
public GetNamespace ( string name ) : NamespaceInfo
name string The name of the namespace.
리턴 NamespaceInfo

GetNamespaces() 공개 메소드

Gets all the sub-namespaces.
public GetNamespaces ( ) : NamespaceInfo[]
리턴 NamespaceInfo[]

GetNavigationPaths() 공개 메소드

Gets all the Navigation Paths in a Namespace.
public GetNavigationPaths ( NamespaceInfo nspace ) : NavigationPath[]
nspace NamespaceInfo The Namespace.
리턴 NavigationPath[]

GetPage() 공개 메소드

Gets a page.
If is null. If is empty.
public GetPage ( string fullName ) : System.PageInfo
fullName string The full name of the page.
리턴 System.PageInfo

GetPages() 공개 메소드

Gets all the Pages in a namespace.
public GetPages ( NamespaceInfo nspace ) : System.PageInfo[]
nspace NamespaceInfo The namespace (null for the root).
리턴 System.PageInfo[]

GetSnippets() 공개 메소드

Gets all the Snippets.
public GetSnippets ( ) : System.Snippet[]
리턴 System.Snippet[]

GetUncategorizedPages() 공개 메소드

Gets all the pages in a namespace that are bound to zero categories.
public GetUncategorizedPages ( NamespaceInfo nspace ) : System.PageInfo[]
nspace NamespaceInfo The namespace (null for the root).
리턴 System.PageInfo[]

Init() 공개 메소드

Initializes the Provider.
If host or config are null. If config is not valid or is incorrect.
public Init ( IHostV30 host, string config ) : void
host IHostV30 The Host of the Provider.
config string The Configuration data, if any.
리턴 void

MergeCategories() 공개 메소드

Merges two Categories.
The destination Category remains, while the source Category is deleted, and all its Pages re-bound in the destination Category.
If or are null.
public MergeCategories ( CategoryInfo source, CategoryInfo destination ) : CategoryInfo
source CategoryInfo The source Category.
destination CategoryInfo The destination Category.
리턴 CategoryInfo

ModifyContentTemplate() 공개 메소드

Modifies an existing content template.
If or are null. If is empty.
public ModifyContentTemplate ( string name, string content ) : ContentTemplate
name string The name of the template to modify.
content string The content of the template.
리턴 ContentTemplate

ModifyMessage() 공개 메소드

Modifies a Message.
If , , or are null. If is less than zero. If or are empty.
public ModifyMessage ( System.PageInfo page, int id, string username, string subject, System.DateTime dateTime, string body ) : bool
page System.PageInfo The Page.
id int The ID of the Message to modify.
username string The Username.
subject string The Subject.
dateTime System.DateTime The Date/Time.
body string The Body.
리턴 bool

ModifyNavigationPath() 공개 메소드

Modifies an existing Navigation Path.
If or are null. If is empty.
public ModifyNavigationPath ( NavigationPath path, System.PageInfo pages ) : NavigationPath
path NavigationPath The Navigation Path to modify.
pages System.PageInfo The new Pages array.
리턴 NavigationPath

ModifyPage() 공개 메소드

Modifies the Content of a Page.
If saveMode equals Draft and a draft already exists, it is overwritten.
If , or are null. If or are empty.
public ModifyPage ( System.PageInfo page, string title, string username, System.DateTime dateTime, string comment, string content, string keywords, string description, SaveMode saveMode ) : bool
page System.PageInfo The Page.
title string The Title of the Page.
username string The Username.
dateTime System.DateTime The Date/Time.
comment string The Comment of the editor, about this revision.
content string The Page Content.
keywords string The keywords, usually used for SEO.
description string The description, usually used for SEO.
saveMode SaveMode The save mode for this modification.
리턴 bool

ModifySnippet() 공개 메소드

Modifies a new Snippet.
If or are null. If is empty.
public ModifySnippet ( string name, string content ) : System.Snippet
name string The Name of the Snippet to modify.
content string The Content of the Snippet.
리턴 System.Snippet

MovePage() 공개 메소드

Moves a page from its namespace into another.
If page is null.
public MovePage ( System.PageInfo page, NamespaceInfo destination, bool copyCategories ) : System.PageInfo
page System.PageInfo The page to move.
destination NamespaceInfo The destination namespace (null for the root).
copyCategories bool A value indicating whether to copy the page categories in the destination /// namespace, if not already available.
리턴 System.PageInfo

PerformSearch() 공개 메소드

Performs a search in the index.
If is null.
public PerformSearch ( SearchParameters parameters ) : SearchResultCollection
parameters ScrewTurn.Wiki.SearchEngine.SearchParameters The search parameters.
리턴 SearchResultCollection

RebindPage() 공개 메소드

Binds a Page with one or more Categories.
After a successful operation, the Page is bound with all and only the categories passed as argument.
If or are null.
public RebindPage ( System.PageInfo page, string categories ) : bool
page System.PageInfo The Page to bind.
categories string The Categories to bind the Page with (full name).
리턴 bool

RebuildIndex() 공개 메소드

Rebuilds the search index.
public RebuildIndex ( ) : void
리턴 void

RemoveCategory() 공개 메소드

Removes a Category.
If is null.
public RemoveCategory ( CategoryInfo category ) : bool
category CategoryInfo The Category to remove.
리턴 bool

RemoveContentTemplate() 공개 메소드

Removes a content template.
If is null. If is empty.
public RemoveContentTemplate ( string name ) : bool
name string The name of the template to remove.
리턴 bool

RemoveMessage() 공개 메소드

Removes a Message.
If is null. If is less than zero.
public RemoveMessage ( System.PageInfo page, int id, bool removeReplies ) : bool
page System.PageInfo The Page.
id int The ID of the Message to remove.
removeReplies bool A value specifying whether or not to remove the replies.
리턴 bool

RemoveNamespace() 공개 메소드

Removes a namespace.
If nspace is null.
public RemoveNamespace ( NamespaceInfo nspace ) : bool
nspace NamespaceInfo The namespace to remove.
리턴 bool

RemoveNavigationPath() 공개 메소드

Removes a Navigation Path.
If is null.
public RemoveNavigationPath ( NavigationPath path ) : bool
path NavigationPath The Navigation Path to remove.
리턴 bool

RemovePage() 공개 메소드

Removes a Page.
If is null.
public RemovePage ( System.PageInfo page ) : bool
page System.PageInfo The Page to remove.
리턴 bool

RemoveSnippet() 공개 메소드

Removes a new Snippet.
If is null. If is empty.
public RemoveSnippet ( string name ) : bool
name string The Name of the Snippet to remove.
리턴 bool

RenameCategory() 공개 메소드

Renames a Category.
If or are null. If is empty.
public RenameCategory ( CategoryInfo category, string newName ) : CategoryInfo
category CategoryInfo The Category to rename.
newName string The new Name.
리턴 CategoryInfo

RenameNamespace() 공개 메소드

Renames a namespace.
If nspace or newName are null. If newName is empty.
public RenameNamespace ( NamespaceInfo nspace, string newName ) : NamespaceInfo
nspace NamespaceInfo The namespace to rename.
newName string The new name of the namespace.
리턴 NamespaceInfo

RenamePage() 공개 메소드

Renames a Page.
If or are null. If is empty.
public RenamePage ( System.PageInfo page, string newName ) : System.PageInfo
page System.PageInfo The Page to rename.
newName string The new Name.
리턴 System.PageInfo

RollbackPage() 공개 메소드

Performs the rollback of a Page to a specified revision.
If is null. If is less than zero.
public RollbackPage ( System.PageInfo page, int revision ) : bool
page System.PageInfo The Page to rollback.
revision int The Revision to rollback the Page to.
리턴 bool

SetBackupContent() 공개 메소드

Forces to overwrite or create a Backup.
If is null. If is less than zero.
public SetBackupContent ( PageContent content, int revision ) : bool
content ScrewTurn.Wiki.PluginFramework.PageContent The Backup content.
revision int The revision.
리턴 bool

SetNamespaceDefaultPage() 공개 메소드

Sets the default page of a namespace.
If nspace is null.
public SetNamespaceDefaultPage ( NamespaceInfo nspace, System.PageInfo page ) : NamespaceInfo
nspace NamespaceInfo The namespace of which to set the default page.
page System.PageInfo The page to use as default page, or null.
리턴 NamespaceInfo

Shutdown() 공개 메소드

Method invoked on shutdown.
This method might not be invoked in some cases.
public Shutdown ( ) : void
리턴 void