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
Afficher le fichier Open project: sdl/dxa-modules

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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

Méthode 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 méthode

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
Résultat void

BuildEntityModel() public méthode

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
Résultat void

BuildPageModel() public méthode

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
Résultat void

CreatePromotionEntity() protected méthode

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
Résultat Sdl.Web.Modules.SmartTarget.Models.SmartTargetPromotion

CreateSmartTargetItem() protected méthode

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