C# Class ScrewTurn.Wiki.SettingsStorageProvider

Implements a Settings Storage Provider against local text pluginAssemblies.
Inheritance: ISettingsStorageProviderV30
显示文件 Open project: mono/ScrewTurnWiki

Public Properties

Property Type Description
ProviderName string

Public Methods

Method Description
AddRecentChange ( string page, string title, string messageSubject, System.DateTime dateTime, string user, ScrewTurn change, string descr ) : bool

Adds a new change.

BeginBulkUpdate ( ) : void

Starts a Bulk update of the Settings so that a bulk of settings can be set before storing them.

ClearLog ( ) : void

Clear the Log.

DeleteOutgoingLinks ( string page ) : bool

Deletes the outgoing links of a page and all the target links that include the page.

DeletePluginAssembly ( string filename ) : bool

Removes a plugin's assembly.

EndBulkUpdate ( ) : void

Ends a Bulk update of the Settings and stores the settings.

GetAllOutgoingLinks ( ) : string[]>.IDictionary

Gets all the outgoing links stored.

GetAllSettings ( ) : string>.IDictionary

Gets the all the setting values.

GetLogEntries ( ) : ScrewTurn.Wiki.PluginFramework.LogEntry[]

Gets all the Log Entries, sorted by date/time (oldest to newest).

The Log Entries.

GetMetaDataItem ( MetaDataItem item, string tag ) : string

Gets a meta-data item's content.

GetOutgoingLinks ( string page ) : string[]

Gets the outgoing links of a page.

GetPluginConfiguration ( string typeName ) : string

Gets the configuration of a plugin.

GetPluginStatus ( string typeName ) : bool

Gets the status of a plugin.

GetRecentChanges ( ) : ScrewTurn.Wiki.PluginFramework.RecentChange[]

Gets the recent changes of the Wiki.

GetSetting ( string name ) : string

Retrieves the value of a Setting.

Init ( IHostV30 host, string config ) : void

Initializes the Storage Provider.

IsFirstApplicationStart ( ) : bool

Determines whether the application was started for the first time.

ListPluginAssemblies ( ) : string[]

Lists the stored plugin assemblies.

LogEntry ( string message, EntryType entryType, string user ) : void

Records a message to the System Log.

This method should not write messages to the Log using the method IHost.LogEntry. This method should also never throw exceptions (except for parameter validation).

RetrievePluginAssembly ( string filename ) : byte[]

Retrieves a plugin's assembly.

SetMetaDataItem ( MetaDataItem item, string tag, string content ) : bool

Sets a meta-data items' content.

SetPluginConfiguration ( string typeName, string config ) : bool

Sets the configuration of a plugin.

SetPluginStatus ( string typeName, bool enabled ) : bool

Sets the status of a plugin.

SetSetting ( string name, string value ) : bool

Stores the value of a Setting.

This method stores the Value immediately.

Shutdown ( ) : void

Method invoked on shutdown.

This method might not be invoked in some cases.

StoreOutgoingLinks ( string page, string outgoingLinks ) : bool

Stores the outgoing links of a page, overwriting existing data.

StorePluginAssembly ( string filename, byte assembly ) : bool

Stores a plugin's assembly, overwriting existing ones if present.

UpdateOutgoingLinksForRename ( string oldName, string newName ) : bool

Updates all outgoing links data for a page rename.

Private Methods

Method Description
CutLog ( int size ) : void

Reduces the size of the Log to the specified size (or less).

CutRecentChanges ( int size ) : void

Reduces the size of the recent changes file to the specified size, deleting old entries.

DumpConfig ( ) : void

Dumps settings on disk.

EntryTypeParse ( string value ) : EntryType

Converts an entry type string to an T:EntryType.

EntryTypeToString ( EntryType type ) : string

Converts an T:EntryType to a string.

GetChange ( string change ) : ScrewTurn.Wiki.PluginFramework.Change

Gets the change from a string.

GetChangeString ( ScrewTurn change ) : string

Gets the change string for a change.

GetFullPath ( string name ) : string
GetFullPathForMetaDataItem ( string tag, string file ) : string

Builds the full path for a meta-data item file.

GetFullPathForPlugin ( string name ) : string
GetFullPathForPluginConfig ( string name ) : string
LoadConfig ( ) : void

Loads configuration settings from disk.

Resanitize ( string input ) : string

Re-sanitizes a string from all unfriendly characters.

Sanitize ( string input ) : string

Sanitizes a stiring from all unfriendly characters.

Method Details

AddRecentChange() public method

Adds a new change.
If page, title or user are null. If page, title or user are empty.
public AddRecentChange ( string page, string title, string messageSubject, System.DateTime dateTime, string user, ScrewTurn change, string descr ) : bool
page string The page name.
title string The page title.
messageSubject string The message subject (or null).
dateTime System.DateTime The date/time.
user string The user.
change ScrewTurn The change.
descr string The description (optional).
return bool

BeginBulkUpdate() public method

Starts a Bulk update of the Settings so that a bulk of settings can be set before storing them.
public BeginBulkUpdate ( ) : void
return void

ClearLog() public method

Clear the Log.
public ClearLog ( ) : void
return void

DeleteOutgoingLinks() public method

Deletes the outgoing links of a page and all the target links that include the page.
If page is null. If page is empty.
public DeleteOutgoingLinks ( string page ) : bool
page string The full name of the page.
return bool

DeletePluginAssembly() public method

Removes a plugin's assembly.
If filename is null. If filename is empty.
public DeletePluginAssembly ( string filename ) : bool
filename string The file name of the assembly to remove, such as "Assembly.dll".
return bool

EndBulkUpdate() public method

Ends a Bulk update of the Settings and stores the settings.
public EndBulkUpdate ( ) : void
return void

GetAllOutgoingLinks() public method

Gets all the outgoing links stored.
public GetAllOutgoingLinks ( ) : string[]>.IDictionary
return string[]>.IDictionary

GetAllSettings() public method

Gets the all the setting values.
public GetAllSettings ( ) : string>.IDictionary
return string>.IDictionary

GetLogEntries() public method

Gets all the Log Entries, sorted by date/time (oldest to newest).
The Log Entries.
public GetLogEntries ( ) : ScrewTurn.Wiki.PluginFramework.LogEntry[]
return ScrewTurn.Wiki.PluginFramework.LogEntry[]

GetMetaDataItem() public method

Gets a meta-data item's content.
public GetMetaDataItem ( MetaDataItem item, string tag ) : string
item MetaDataItem The item.
tag string The tag that specifies the context (usually the namespace).
return string

GetOutgoingLinks() public method

Gets the outgoing links of a page.
If page is null. If page is empty.
public GetOutgoingLinks ( string page ) : string[]
page string The full name of the page.
return string[]

GetPluginConfiguration() public method

Gets the configuration of a plugin.
If typeName is null. If typeName is empty.
public GetPluginConfiguration ( string typeName ) : string
typeName string The Type name of the plugin.
return string

GetPluginStatus() public method

Gets the status of a plugin.
If typeName is null. If typeName is empty.
public GetPluginStatus ( string typeName ) : bool
typeName string The Type name of the plugin.
return bool

GetRecentChanges() public method

Gets the recent changes of the Wiki.
public GetRecentChanges ( ) : ScrewTurn.Wiki.PluginFramework.RecentChange[]
return ScrewTurn.Wiki.PluginFramework.RecentChange[]

GetSetting() public method

Retrieves the value of a Setting.
If name is null. If name is empty.
public GetSetting ( string name ) : string
name string The name of the Setting.
return string

Init() public method

Initializes the Storage 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 Component.
config string The Configuration data, if any.
return void

IsFirstApplicationStart() public method

Determines whether the application was started for the first time.
public IsFirstApplicationStart ( ) : bool
return bool

ListPluginAssemblies() public method

Lists the stored plugin assemblies.
public ListPluginAssemblies ( ) : string[]
return string[]

LogEntry() public method

Records a message to the System Log.
This method should not write messages to the Log using the method IHost.LogEntry. This method should also never throw exceptions (except for parameter validation).
If message or user are null. If message or user are empty.
public LogEntry ( string message, EntryType entryType, string user ) : void
message string The Log Message.
entryType EntryType The Type of the Entry.
user string The User.
return void

RetrievePluginAssembly() public method

Retrieves a plugin's assembly.
If filename is null. If filename is empty.
public RetrievePluginAssembly ( string filename ) : byte[]
filename string The file name of the assembly.
return byte[]

SetMetaDataItem() public method

Sets a meta-data items' content.
public SetMetaDataItem ( MetaDataItem item, string tag, string content ) : bool
item MetaDataItem The item.
tag string The tag that specifies the context (usually the namespace).
content string The content.
return bool

SetPluginConfiguration() public method

Sets the configuration of a plugin.
If typeName is null. If typeName is empty.
public SetPluginConfiguration ( string typeName, string config ) : bool
typeName string The Type name of the plugin.
config string The configuration.
return bool

SetPluginStatus() public method

Sets the status of a plugin.
If typeName is null. If typeName is empty.
public SetPluginStatus ( string typeName, bool enabled ) : bool
typeName string The Type name of the plugin.
enabled bool The plugin status.
return bool

SetSetting() public method

Stores the value of a Setting.
This method stores the Value immediately.
If name is null. If name is empty.
public SetSetting ( string name, string value ) : bool
name string The name of the Setting.
value string The value of the Setting. Value cannot contain CR and LF characters, which will be removed.
return bool

Shutdown() public method

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

StoreOutgoingLinks() public method

Stores the outgoing links of a page, overwriting existing data.
If page or outgoingLinks are null. If page or outgoingLinks are empty.
public StoreOutgoingLinks ( string page, string outgoingLinks ) : bool
page string The full name of the page.
outgoingLinks string The full names of the pages that page links to.
return bool

StorePluginAssembly() public method

Stores a plugin's assembly, overwriting existing ones if present.
If filename or assembly are null. If filename or assembly are empty.
public StorePluginAssembly ( string filename, byte assembly ) : bool
filename string The file name of the assembly, such as "Assembly.dll".
assembly byte The assembly content.
return bool

UpdateOutgoingLinksForRename() public method

Updates all outgoing links data for a page rename.
If oldName or newName are null. If oldName or newName are empty.
public UpdateOutgoingLinksForRename ( string oldName, string newName ) : bool
oldName string The old page name.
newName string The new page name.
return bool

Property Details

ProviderName public_oe static_oe property

The name of the provider.
public static string ProviderName
return string