C# Class ScrewTurn.Wiki.Plugins.SqlCommon.SqlSettingsStorageProviderBase

Implements a base class for a SQL settings storage provider.
Inheritance: SqlStorageProviderBase, ISettingsStorageProviderV30
Mostra file Open project: mono/ScrewTurnWiki

Protected Properties

Property Type Description
isFirstStart bool

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).

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.

If the configuration string is not valid, the methoud should throw a InvalidConfigurationException.

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.

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
AclEntryValueFromChar ( char c ) : Value

Converts a character representation of a T:Value back to the enum value.

AclEntryValueToChar ( Value value ) : char

Converts a T:Value to its corresponding character representation.

CutLog ( int size ) : void

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

CutRecentChangesIfNecessary ( ) : void

Cuts the recent changes if necessary.

DeleteEntries ( AclEntry entries ) : bool

Deletes some ACL entries.

DeletePluginAssembly ( DbConnection connection, string filename ) : bool

Removes a plugin's assembly.

DeletePluginAssembly ( DbTransaction transaction, string filename ) : bool

Removes a plugin's assembly.

EntryTypeFromChar ( char c ) : EntryType

Converts the character representation of an T:EntryType back to the enumeration value.

EntryTypeToChar ( EntryType type ) : char

Converts an T:EntryType to its character representation.

PreparePluginStatusRow ( DbTransaction transaction, string typeName ) : void

Prepares the plugin status row, if necessary.

RecentChangeFromChar ( char c ) : ScrewTurn.Wiki.PluginFramework.Change

Converts a character representation of a T:ScrewTurn.Wiki.PluginFramework.Change back to the enum value.

RecentChangeToChar ( ScrewTurn change ) : char

Converts a T:ScrewTurn.Wiki.PluginFramework.Change to its character representation.

RenameAclResource ( string resource, string newName ) : bool

Renames a ACL resource.

RetrieveAclEntriesForResource ( string resource ) : ScrewTurn.Wiki.AclEngine.AclEntry[]

Retrieves all ACL entries for a resource.

RetrieveAclEntriesForSubject ( string subject ) : ScrewTurn.Wiki.AclEngine.AclEntry[]

Retrieves all ACL entries for a subject.

RetrieveAllAclEntries ( ) : ScrewTurn.Wiki.AclEngine.AclEntry[]

Retrieves all ACL entries.

Sanitize ( string input ) : string

Sanitizes a stiring from all unfriendly characters.

StoreEntry ( AclEntry entry ) : bool

Stores a ACL entry.

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).
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 the configuration string is not valid, the methoud should throw a InvalidConfigurationException.
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.
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

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

isFirstStart protected_oe property

Holds a value indicating whether the application was started for the first time.
protected bool isFirstStart
return bool