C# Class Sdl.Web.Tridion.Mapping.DefaultContentProvider

Default Content Provider implementation (DD4T-based).
Inheritance: IContentProvider, IRawDataProvider
Show file Open project: sdl/dxa-web-application-dotnet

Private Properties

Property Type Description
GetPageModel Sdl.Web.Common.Models.PageModel
PopulateDynamicList Sdl.Web.Common.Models.DynamicList

Public Methods

Method Description
GetEntityModel ( string id, Sdl.Web.Common.Configuration.Localization localization ) : EntityModel

Gets an Entity Model for a given Entity Identifier.

Since we can't obtain CT metadata for DCPs, we obtain the View Name from the CT Title.

GetPageContent ( string urlPath, Sdl.Web.Common.Configuration.Localization localization ) : string
GetPageModel ( string urlPath, Sdl.Web.Common.Configuration.Localization localization, bool addIncludes ) : PageModel

Gets a Page Model for a given URL.

GetStaticContentItem ( string urlPath, Sdl.Web.Common.Configuration.Localization localization ) : Sdl.Web.Common.Models.StaticContentItem

Gets a Static Content Item for a given URL path.

PopulateDynamicList ( DynamicList dynamicList, Sdl.Web.Common.Configuration.Localization localization ) : void

Populates a Dynamic List by executing the query it specifies.

Protected Methods

Method Description
GetCmUrl ( string urlPath ) : string

Converts a request URL path into a CMS URL (for example adding default page name and file extension)

GetIncludesFromModel ( DD4T.ContentModel.IPage page, Sdl.Web.Common.Configuration.Localization localization ) : IEnumerable
GetPage ( string urlPath, Sdl.Web.Common.Configuration.Localization localization ) : DD4T.ContentModel.IPage

Private Methods

Method Description
GetPageModel ( string urlPath, bool addIncludes = true ) : PageModel
PopulateDynamicList ( DynamicList dynamicList ) : DynamicList

Method Details

GetCmUrl() protected method

Converts a request URL path into a CMS URL (for example adding default page name and file extension)
protected GetCmUrl ( string urlPath ) : string
urlPath string The request URL path (unescaped)
return string

GetEntityModel() public method

Gets an Entity Model for a given Entity Identifier.
Since we can't obtain CT metadata for DCPs, we obtain the View Name from the CT Title.
If no Entity Model exists for the given URL.
public GetEntityModel ( string id, Sdl.Web.Common.Configuration.Localization localization ) : EntityModel
id string The Entity Identifier in format ComponentID-TemplateID.
localization Sdl.Web.Common.Configuration.Localization The context Localization.
return Sdl.Web.Common.Models.EntityModel

GetIncludesFromModel() protected method

protected GetIncludesFromModel ( DD4T.ContentModel.IPage page, Sdl.Web.Common.Configuration.Localization localization ) : IEnumerable
page DD4T.ContentModel.IPage
localization Sdl.Web.Common.Configuration.Localization
return IEnumerable

GetPage() protected method

protected GetPage ( string urlPath, Sdl.Web.Common.Configuration.Localization localization ) : DD4T.ContentModel.IPage
urlPath string
localization Sdl.Web.Common.Configuration.Localization
return DD4T.ContentModel.IPage

GetPageContent() public method

public GetPageContent ( string urlPath, Sdl.Web.Common.Configuration.Localization localization ) : string
urlPath string
localization Sdl.Web.Common.Configuration.Localization
return string

GetPageModel() public method

Gets a Page Model for a given URL.
If no Page Model exists for the given URL.
public GetPageModel ( string urlPath, Sdl.Web.Common.Configuration.Localization localization, bool addIncludes ) : PageModel
urlPath string The URL path (unescaped).
localization Sdl.Web.Common.Configuration.Localization The context Localization.
addIncludes bool Indicates whether include Pages should be expanded.
return Sdl.Web.Common.Models.PageModel

GetStaticContentItem() public method

Gets a Static Content Item for a given URL path.
public GetStaticContentItem ( string urlPath, Sdl.Web.Common.Configuration.Localization localization ) : Sdl.Web.Common.Models.StaticContentItem
urlPath string The URL path (unescaped).
localization Sdl.Web.Common.Configuration.Localization The context Localization.
return Sdl.Web.Common.Models.StaticContentItem

PopulateDynamicList() public method

Populates a Dynamic List by executing the query it specifies.
public PopulateDynamicList ( DynamicList dynamicList, Sdl.Web.Common.Configuration.Localization localization ) : void
dynamicList Sdl.Web.Common.Models.DynamicList The Dynamic List which specifies the query and is to be populated.
localization Sdl.Web.Common.Configuration.Localization The context Localization.
return void