SaaS CMS has officially launched! Learn more now.

Class ContentDataBuilder

Default implementation of IContentDataBuilder

Inheritance
System.Object
ContentDataBuilder
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Construction
Assembly: EPiServer.dll
Version: 7.19.2
Syntax
public class ContentDataBuilder : IContentDataBuilder

Constructors

ContentDataBuilder(IPropertyDataFactory, BlockTypeRepository, IContentDataFactory<BlockData>, ILanguageBranchRepository, IFolderIDGenerator)

Initializes a new instance of the ContentDataBuilder class.

Declaration
public ContentDataBuilder(IPropertyDataFactory propertyDataFactory, BlockTypeRepository blockTypeRepository, IContentDataFactory<BlockData> blockContentFactory, ILanguageBranchRepository languageBranchRepository, IFolderIDGenerator folderIdGenerator)
Parameters
Type Name Description
IPropertyDataFactory propertyDataFactory

The property data factory.

BlockTypeRepository blockTypeRepository

The block type repository.

IContentDataFactory<BlockData> blockContentFactory

The block content factory.

ILanguageBranchRepository languageBranchRepository

The language branch repository.

IFolderIDGenerator folderIdGenerator

The folder id generator.

Properties

FolderIDGenerator

Gets the folder ID generator.

Declaration
protected virtual IFolderIDGenerator FolderIDGenerator { get; }
Property Value
Type Description
IFolderIDGenerator

The folder ID generator.

LanguageBranchRepository

Gets the language branch repository.

Declaration
protected virtual ILanguageBranchRepository LanguageBranchRepository { get; }
Property Value
Type Description
ILanguageBranchRepository

The language branch repository.

RequestTimeGetter

Delegate to get current time for request, default implementation is EPiServer.BaseLibrary.Context.Current.RequestTime.

Declaration
public Func<DateTime> RequestTimeGetter { get; set; }
Property Value
Type Description
System.Func<System.DateTime>

The request time getter.

Remarks

This is exposed mainly for testing purposes to avoid having to set up BaseLibrary in tests.

Methods

AddContentTypeProperties(IContentData, ContentType)

Adds the content type properties.

Declaration
protected void AddContentTypeProperties(IContentData contentData, ContentType contentType)
Parameters
Type Name Description
IContentData contentData

The content data.

ContentType contentType

Type of the content.

AddProperties(IContentData, BuildingContext)

Adds properties to the contentData according to the buildingContext

Declaration
public virtual void AddProperties(IContentData contentData, BuildingContext buildingContext)
Parameters
Type Name Description
IContentData contentData

The contentData to populate with properties.

BuildingContext buildingContext

The building context.

SetDefaultPropertyValues(IContentData, IContentData, ContentType)

Sets the default property values.

Declaration
protected virtual void SetDefaultPropertyValues(IContentData child, IContentData parent, ContentType type)
Parameters
Type Name Description
IContentData child

The child.

IContentData parent

The parent.

ContentType type

The type.

SetIdentity(IContent, BuildingContext)

Sets the identity of the IContent instance

Declaration
protected void SetIdentity(IContent content, BuildingContext buildingContext)
Parameters
Type Name Description
IContent content

The content.

BuildingContext buildingContext

The building context.

SetInheritedData(IContent, IContent, ContentType)

Sets any system defined default values inherited from their parents.

Declaration
protected virtual void SetInheritedData(IContent content, IContent parentData, ContentType contentType)
Parameters
Type Name Description
IContent content

The content.

IContent parentData

The parent page data.

ContentType contentType

Type of the content.

SetLanguageProperties(IContent, ILanguageSelector)

Sets the language properties for the page according to the passed in languageSelector

Declaration
protected virtual void SetLanguageProperties(IContent content, ILanguageSelector languageSelector)
Parameters
Type Name Description
IContent content

The content.

ILanguageSelector languageSelector

The language selector.

ValidateParameters(IContentData, BuildingContext)

Validates the parameters.

Declaration
protected void ValidateParameters(IContentData contentData, BuildingContext buildingContext)
Parameters
Type Name Description
IContentData contentData

The content data.

BuildingContext buildingContext

The building context.

Implements

Extension Methods