The interaction between your application and Sewen is to be done using the Altairis.Sewen.PageStoreManager class.

PageStoreManager methods

This static has several methods, that can be called either from code or declaratively, using the ObjectDataSource ASP.NET server control.

Getting page

public static SewenPage LoadPage(string name)
Returns latest available version of page with given name or null if no such page was found.

public static SewenPage LoadPage(string name, DateTime version)
Returns latest available version of page, which was available on specified date, or null if no such page was found.

public static SewenPage LoadPage(string name, string versionString)
The same as previous overload, only the date is specified as string in yyyyMMddHHmmssfff format - used for databinding scenarios.

Creating and editing page

public static void SavePage(SewenPage page)
Saves new version of a page or creates new page.

Listing all page versions

public static IEnumerable<SewenPage> LoadPageVersions(string name)
Lists all versions of given page.

Searching for page

public static IEnumerable<SewenPage> FindPagesByTitle(string searchString)
public static IEnumerable<SewenPage> FindPagesByTitle(string searchString, StringSearchMode mode)
Finds all pages whose title begins, ends with or contains the specified string. The specific implementation depends on used provider.

Using the above methods trough ObjectDataSource

See the sample applications for example of using the PageStoreManager methods declaratively. Typical usage for displaying and editing pages is:
<asp:ObjectDataSource ID="PageObjectDataSource" runat="server" 
    TypeName="Altairis.Sewen.PageStoreManager" 
    DataObjectTypeName="Altairis.Sewen.SewenPage" 
    SelectMethod="LoadPage" 
    InsertMethod="SavePage" 
    UpdateMethod="SavePage">
    <SelectParameters>
        <asp:QueryStringParameter Name="name" QueryStringField="page" Type="String" DefaultValue="home-page" />
        <asp:QueryStringParameter Name="versionString" QueryStringField="version" Type="String" />
    </SelectParameters>
</asp:ObjectDataSource>

Last edited May 29, 2011 at 11:54 AM by altair, version 1

Comments

No comments yet.