This project is read-only.
The TablePageStoreProvider is provider for storing Wiki pages in relational database. The provider itself is database agnostic and can use any database, for which you have ADO.NET provider installed. The officially tested and supported databases are Microsoft SQL Server and SQL Server Compact, but the provider should work with Oracle, MySQL, Firebird... basically any database, as long as it has ADO.NET provider and understands simple SQL.

Database configuration

Provider requires single table, name of which is configurable (the default being Pages). The required table may be created usign the following SQL code (for Microsoft SQL Server, modify accordingly for other databases):
CREATE TABLE Pages(
    Slug        nvarchar(100)    NOT NULL,
    Version     datetime         NOT NULL,
    UserName    nvarchar(100)    NULL,
    IpAddress   nvarchar(40)     NOT NULL,
    Title       nvarchar(max)    NOT NULL,
    Body        nvarchar(max)    NOT NULL,
    Comment     nvarchar(max)    NULL,
)

-- Add primary key (not required, but recommended)
ALTER TABLE Pages ADD CONSTRAINT PK_Pages PRIMARY KEY CLUSTERED (Slug ASC, Version ASC)

Provider configuration

The following is sample configuration of TablePageStoreProvider:
<configuration>
    <!-- Register configuration section -->
    <configSections>
        <section name="altairis.sewen" 
                 type="Altairis.Sewen.Configuration.SewenConfigurationSection, Altairis.Sewen.Core" />
    </configSections>
    <!-- Set connection string -->
    <connectionStrings>
        <add name="SewenPageStoreDB" 
             connectionString="SERVER=.\SqlExpress;TRUSTED_CONNECTION=yes;DATABASE=Sewen;"
             providerName="System.Data.SqlClient" />
    </connectionStrings>
    <!-- SEWEN configuration for routing -->
    <altairis.sewen>
        <wikiLink resolveMode="Route" routeName="SewenWikiPage" slugValueName="slug" />
        <store defaultProvider="DbProvider">
            <providers>
                <add name="DbProvider" 
                     type="Altairis.Sewen.PageStore.TablePageStoreProvider, Altairis.Sewen.Core" 
                     connectionStringName="SewenPageStoreDB"
                     tableName="Pages"
                     versionTimeKind="Local" />
            </providers>
        </store>
    </altairis.sewen>
    <!-- rest of configuration goes here -->
</configuration>

TablePageStoreProvider Configuration Attributes

Name Mandatory Comment
name yes Logical provider name
type yes Name of the type class, must be Altairis.Sewen.PageStore.TablePageStoreProvider, Altairis.Sewen.Core
connectionStringName yes Name of database connection string defined in connectionStrings section
tableName no Name of SQL table, defaults to Pages
versionTimeKind no May be Local (default) or Utc - timestamp version kind

Last edited May 29, 2011 at 12:52 PM by altair, version 1

Comments

No comments yet.