Class ContentDataBuilder
Default implementation of IContentDataBuilder
Inheritance
Namespace: EPiServer.Construction.Internal
Assembly: EPiServer.dll
Version: 12.0.3Syntax
[ServiceConfiguration]
[ServiceConfiguration]
public class ContentDataBuilder : Object, IContentDataBuilder, IPropertyBlockBuilder
Constructors
ContentDataBuilder(IPropertyDataFactory, IContentTypeRepository, IContentDataFactory<BlockData>, ILanguageBranchRepository, IPageDataMetadataBuilder, IContentLanguageAccessor, IPrincipalAccessor)
Initializes a new instance of the ContentDataBuilder class.
Declaration
public ContentDataBuilder(IPropertyDataFactory propertyDataFactory, IContentTypeRepository contentTypeRepository, IContentDataFactory<BlockData> blockContentFactory, ILanguageBranchRepository languageBranchRepository, IPageDataMetadataBuilder pageDataMetadataBuilder, IContentLanguageAccessor languageAccessor, IPrincipalAccessor principalAccessor)
Parameters
Type | Name | Description |
---|---|---|
IPropertyDataFactory | propertyDataFactory | |
IContentTypeRepository | contentTypeRepository | |
IContentDataFactory<BlockData> | blockContentFactory | |
ILanguageBranchRepository | languageBranchRepository | |
IPageDataMetadataBuilder | pageDataMetadataBuilder | |
IContentLanguageAccessor | languageAccessor | |
IPrincipalAccessor | principalAccessor |
Properties
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 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. |
AddProperties(IPropertyBlock, BlockPropertyDefinitionType)
Declaration
public void AddProperties(IPropertyBlock blockProperty, BlockPropertyDefinitionType blockDefintionType)
Parameters
Type | Name | Description |
---|---|---|
IPropertyBlock | blockProperty | |
BlockPropertyDefinitionType | blockDefintionType |
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. |