C# Class Sdl.Web.Modules.SmartTarget.Mapping.SmartTargetModelBuilder

SmartTarget Model Builder.
This Model Builder should be configured in the modelBuilderPipeline section in Web.config to run after the DefaultModelBuilder.
Inheritance: IModelBuilder
Exibir arquivo Open project: sdl/dxa-modules

Public Methods

Method Description
BuildEntityModel ( EntityModel &entityModel, IComponent component, Type baseModelType, Sdl.Web.Common.Configuration.Localization localization ) : void
BuildEntityModel ( EntityModel &entityModel, IComponentPresentation cp, Sdl.Web.Common.Configuration.Localization localization ) : void
BuildPageModel ( PageModel &pageModel, DD4T.ContentModel.IPage page, IEnumerable includes, Sdl.Web.Common.Configuration.Localization localization ) : void

Post-processes the Page Model constructed by the DefaultModelBuilder.

This implementation relies on the DefaultModelBuilder already having constructed Region Models of type SmartTargetRegion. We "upgrade" the Page Model to type SmartTargetPageModel and populate the ST Regions SmartTargetPromotion Entities.

Protected Methods

Method Description
CreatePromotionEntity ( Promotion promotion, string viewName, string regionName, Sdl.Web.Common.Configuration.Localization localization, ExperimentDimensions experimentDimensions ) : SmartTargetPromotion
CreateSmartTargetItem ( System.Item item, Sdl.Web.Common.Configuration.Localization localization ) : SmartTargetItem

Private Methods

Method Description
ExecuteSmartTargetQuery ( SmartTargetPageModel smartTargetPageModel, Sdl.Web.Common.Configuration.Localization localization ) : ResultSet
GetAllowDuplicatesOnSamePage ( IPageTemplate pageTemplate, Sdl.Web.Common.Configuration.Localization localization ) : bool

Determines whether duplicate ST Items are allowed on this page.

Method Details

BuildEntityModel() public method

public BuildEntityModel ( EntityModel &entityModel, IComponent component, Type baseModelType, Sdl.Web.Common.Configuration.Localization localization ) : void
entityModel Sdl.Web.Common.Models.EntityModel
component IComponent
baseModelType System.Type
localization Sdl.Web.Common.Configuration.Localization
return void

BuildEntityModel() public method

public BuildEntityModel ( EntityModel &entityModel, IComponentPresentation cp, Sdl.Web.Common.Configuration.Localization localization ) : void
entityModel Sdl.Web.Common.Models.EntityModel
cp IComponentPresentation
localization Sdl.Web.Common.Configuration.Localization
return void

BuildPageModel() public method

Post-processes the Page Model constructed by the DefaultModelBuilder.
This implementation relies on the DefaultModelBuilder already having constructed Region Models of type SmartTargetRegion. We "upgrade" the Page Model to type SmartTargetPageModel and populate the ST Regions SmartTargetPromotion Entities.
public BuildPageModel ( PageModel &pageModel, DD4T.ContentModel.IPage page, IEnumerable includes, Sdl.Web.Common.Configuration.Localization localization ) : void
pageModel Sdl.Web.Common.Models.PageModel
page DD4T.ContentModel.IPage
includes IEnumerable
localization Sdl.Web.Common.Configuration.Localization
return void

CreatePromotionEntity() protected method

protected CreatePromotionEntity ( Promotion promotion, string viewName, string regionName, Sdl.Web.Common.Configuration.Localization localization, ExperimentDimensions experimentDimensions ) : SmartTargetPromotion
promotion Promotion
viewName string
regionName string
localization Sdl.Web.Common.Configuration.Localization
experimentDimensions ExperimentDimensions
return Sdl.Web.Modules.SmartTarget.Models.SmartTargetPromotion

CreateSmartTargetItem() protected method

protected CreateSmartTargetItem ( System.Item item, Sdl.Web.Common.Configuration.Localization localization ) : SmartTargetItem
item System.Item
localization Sdl.Web.Common.Configuration.Localization
return Sdl.Web.Modules.SmartTarget.Models.SmartTargetItem