This project is read-only.
Sewen uses provider-based storage model - similar to what you can see in the .NET framework itself, most notable case being the Membership and Role providers in ASP.NET. The core does not care how exactly are the page data are stored. Instead uses a defined API, where the tasks itself are fulfilled by provider implementation.

Configuring the Page Store Providers

Which provider is used by the application is set in configuration, in the web.config file. First, you must register the altairis.sewen configuration section:
<configSections>
    <section name="altairis.sewen" 
             type="Altairis.Sewen.Configuration.SewenConfigurationSection, Altairis.Sewen.Core" />
</configSections>

Second, add the providers you want to use and select default one. The following code registers the two providers being part of the core assembly and selects the database-based one as a default:
<altairis.sewen>
    <store defaultProvider="DbProvider">
        <providers>
            <add name="DbProvider"
                 type="Altairis.Sewen.PageStore.TablePageStoreProvider, Altairis.Sewen.Core"
                 connectionStringName="SewenPageStoreDB" />
            <add name="FileProvider"
                 type="Altairis.Sewen.PageStore.FilePageStoreProvider, Altairis.Sewen.Core"
                 dataFolderPath="~/App_Data/Sewen/" />
        </providers>
    </store>
</altairis.sewen>

The add element can have attributes for configuration the particular provider. See pages for TablePageStoreProvider and FilePageStoreProvider for details.

Creating the storage

The process of creating backing storage depends on the provider used. For example, the file-based FilePageStoreProvider requires you just to create empty folder, where it can manage its files. To use database-based TablePageStoreProvider, you must create the database and table with defined structure.

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

Comments

No comments yet.