Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.

 

Class PageVersionDataSource

Provides PageVersion data to DataBoundControl implementations.

Inheritance
System.Object
PageVersionDataSource
Implements
Inherited Members
Namespace: EPiServer.Web.WebControls
Assembly: EPiServer.dll
Version: 7.19.2
Syntax
public class PageVersionDataSource : GenericDataSource<PageVersion, PageVersionCollection, PageReference>, IDataSourceMethods
Remarks

This class does not use the GenericDataSource base class since it lacks a public default ctor.

Constructors

PageVersionDataSource()

Declaration
public PageVersionDataSource()

Properties

ContentVersionService

Declaration
public Injected<IContentVersionRepository> ContentVersionService { get; set; }
Property Value
Type Description
Injected<IContentVersionRepository>

LanguageBranch

Gets or sets a language branch to view and edit versions for

Declaration
public string LanguageBranch { get; set; }
Property Value
Type Description
System.String

Gets or sets a references to the page to view and edit versions for

Declaration
public PageReference PageLink { get; set; }
Property Value
Type Description
PageReference

Methods

CreateItem(List<PageVersion>)

Creation of PageVersion is not supported.

Declaration
protected override PageVersion CreateItem(List<PageVersion> items)
Parameters
Type Name Description
System.Collections.Generic.List<PageVersion> items

the list of current instances in the given scope.

Returns
Type Description
PageVersion
Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.DataAbstraction.PageVersion, EPiServer.DataAbstraction.PageVersionCollection, EPiServer.Core.PageReference>.CreateItem(System.Collections.Generic.List<EPiServer.DataAbstraction.PageVersion>)
Remarks

Since PageVersionDataSource not support creation of items it will alwys throw System.NotSupportedException

Exceptions
Type Condition
System.NotSupportedException

Is always thrown

DeleteItem(PageVersion)

Deletes a specific PageVersion

Declaration
protected override void DeleteItem(PageVersion item)
Parameters
Type Name Description
PageVersion item

The item to delete.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.DataAbstraction.PageVersion, EPiServer.DataAbstraction.PageVersionCollection, EPiServer.Core.PageReference>.DeleteItem(EPiServer.DataAbstraction.PageVersion)

ListItems()

Lists all page versions for specified PageLink. If LanguageBranch is given only version for that language is listed otherwise all versions for all languages are listed.

Declaration
protected override List<PageVersion> ListItems()
Returns
Type Description
System.Collections.Generic.List<PageVersion>

a list of instances.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.DataAbstraction.PageVersion, EPiServer.DataAbstraction.PageVersionCollection, EPiServer.Core.PageReference>.ListItems()

LoadItem(PageReference)

Loads a specific page version.

Declaration
protected override PageVersion LoadItem(PageReference key)
Parameters
Type Name Description
PageReference key

The key of the instance to load.

Returns
Type Description
PageVersion

A object instance.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.DataAbstraction.PageVersion, EPiServer.DataAbstraction.PageVersionCollection, EPiServer.Core.PageReference>.LoadItem(EPiServer.Core.PageReference)

SaveItem(PageVersion)

Updates of PageVersion is not supported through PageVersionDataSource.

Declaration
protected override void SaveItem(PageVersion item)
Parameters
Type Name Description
PageVersion item

The item to persist.

Overrides
EPiServer.Web.WebControls.GenericDataSource<EPiServer.DataAbstraction.PageVersion, EPiServer.DataAbstraction.PageVersionCollection, EPiServer.Core.PageReference>.SaveItem(EPiServer.DataAbstraction.PageVersion)
Exceptions
Type Condition
System.NotSupportedException

Is always thrown

Implements

Extension Methods