Try our conversational search powered by Generative AI!

Class ContentFactory

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Helper class for creating content data instances such as PageData, Shared blocks and IContent according to the ContentType.

Inheritance
System.Object
ContentFactory
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.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public class ContentFactory : IContentFactory
Remarks

This classes encapsulates various factories and builders used to create and build up various content instances depending on the ContentType.

Constructors

ContentFactory(ISharedBlockFactory, IContentDataFactory<IContent>, IContentDataFactory<PageData>, IContentDataBuilder, IPropertyDataFactory, IObjectInstanceCache, IContentCacheKeyCreator, IContentTypeBaseResolver)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the ContentFactory class.

Declaration
public ContentFactory(ISharedBlockFactory sharedblockFactory, IContentDataFactory<IContent> contentFactory, IContentDataFactory<PageData> pageDataFactory, IContentDataBuilder contentDataBuilder, IPropertyDataFactory propertyDataFactory, IObjectInstanceCache cache, IContentCacheKeyCreator contentCacheKeyCreator, IContentTypeBaseResolver contentTypeBaseResolver)
Parameters
Type Name Description
ISharedBlockFactory sharedblockFactory

The block host factory used to create shared block instances.

IContentDataFactory<IContent> contentFactory

The content factory used to create IContent instances that are not pages or hosted blocks.

IContentDataFactory<PageData> pageDataFactory

The page factory used to create PageData instances.

IContentDataBuilder contentDataBuilder

The content data builder used to build up IContent that are not PageData instances.

IPropertyDataFactory propertyDataFactory

The property data factory used by contentDataBuilder

IObjectInstanceCache cache

The cache used

IContentCacheKeyCreator contentCacheKeyCreator

The creator of cache keys

IContentTypeBaseResolver contentTypeBaseResolver

The content type base resolver

Properties

ContentDataBuilder

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the content data builder used to add PropertyData instances to a IContent instances.

Declaration
protected IContentDataBuilder ContentDataBuilder { get; }
Property Value
Type Description
IContentDataBuilder

IContentFactory

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the content factory used to create IContent instances.

Declaration
protected IContentDataFactory<IContent> IContentFactory { get; }
Property Value
Type Description
IContentDataFactory<IContent>

PageDataFactory

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the PageData factory used to create PageData instances.

Declaration
protected IContentDataFactory<PageData> PageDataFactory { get; }
Property Value
Type Description
IContentDataFactory<PageData>

PropertyDataFactory

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the property data factory used to create PropertyData instances.

Declaration
protected IPropertyDataFactory PropertyDataFactory { get; }
Property Value
Type Description
IPropertyDataFactory

The property data factory.

SharedBlockFactory

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the block host factory used to create shared BlockData instances.

Declaration
protected ISharedBlockFactory SharedBlockFactory { get; }
Property Value
Type Description
ISharedBlockFactory

Methods

CreateContent(ContentType)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Creates an instance of IContent and populates the instance with properties according to the passed in ContentType.

Declaration
public virtual IContent CreateContent(ContentType contentType)
Parameters
Type Name Description
ContentType contentType

Type of the content.

Returns
Type Description
IContent
Remarks

The implemetation will call overload with a BuildingContext set so no property values are set.

CreateContent(ContentType, BuildingContext)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Creates an instance of IContent and populates the instance with properties according to the passed in ContentType.

Declaration
public virtual IContent CreateContent(ContentType contentType, BuildingContext buildingContext)
Parameters
Type Name Description
ContentType contentType

Type of the content.

BuildingContext buildingContext

The building context.

Returns
Type Description
IContent
Remarks

Depending on type of contentType (e.g. PageType, BlockType) the suitable encapsulated factory and builder instance will be used to create and build up an IContent instance.

Depending on buildingContext default values and inherited values will be set.

Implements

Extension Methods