Class ContentChannelHandlerBase

Base class that provides event support for various Content Channel Handler events.

Inheritance
System.Object
ContentChannelHandlerBase
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.ContentChannels
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public abstract class ContentChannelHandlerBase : IContentChannelHandler

Constructors

ContentChannelHandlerBase()

Declaration
protected ContentChannelHandlerBase()

Methods

AppendDataToFile(String, String, Byte[], Boolean)

Appends data to a file.

Declaration
public abstract void AppendDataToFile(string channelId, string virtualFilePath, byte[] data, bool expectMoreData)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used

System.String virtualFilePath

The virtual path to the file

System.Byte[] data

The data to append to the file

System.Boolean expectMoreData

if set to true data is chunked and more data is expected.

DeleteContent(String, Guid)

Deletes the content with specified id.

Declaration
public abstract void DeleteContent(string channelId, Guid contentId)
Parameters
Type Name Description
System.String channelId

The channel id.

System.Guid contentId

The content id.

Remarks

All languages of the page will be deleted

DeleteContentLanguage(String, Guid, String)

Deletes a language version of a content item.

Declaration
public abstract void DeleteContentLanguage(string channelId, Guid contentId, string cultureName)
Parameters
Type Name Description
System.String channelId

The channel id.

System.Guid contentId

The content id.

System.String cultureName

Name of the culture.

Remarks

It is not possible to delete MasterLanguage for a content without deleting content for all languages. In that case DeleteContent should be called without cultureName

Exceptions
Type Condition
System.InvalidOperationException

Will be thrown if language is MasterLanguage for content

DeleteDirectory(String, String)

Deletes the directory with the specified virtual path (which can be relative channel rootpath).

Declaration
public abstract void DeleteDirectory(string channelId, string virtualFilePath)
Parameters
Type Name Description
System.String channelId

The channel id.

System.String virtualFilePath

The virtual file path. If the path not starts with '~/' it will be appended to channel root path

DeleteFile(String, Guid, String)

Deletes a file from the page directory PageFile with the specified parent page and file name.

Declaration
public abstract void DeleteFile(string channelId, Guid pageId, string fileName)
Parameters
Type Name Description
System.String channelId

The channel id

System.Guid pageId

Id of parent page

System.String fileName

Name of file

DeleteFile(String, String)

Deletes the file with the specified virtual path (which can be relative channel rootpath).

Declaration
public abstract void DeleteFile(string channelId, string virtualFilePath)
Parameters
Type Name Description
System.String channelId

The channel id.

System.String virtualFilePath

The virtual file path. If the path not starts with '~/' it will be appended to channel root path

ImportContent(String, String, IDictionary<String, String>)

Creates a new content in EpiServer according to specified data and channel data.

Declaration
public abstract Guid ImportContent(string channelId, string contentName, IDictionary<string, string> propertyMap)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.String contentName

Name of the content.

System.Collections.Generic.IDictionary<System.String, System.String> propertyMap

The property map consisting of property name/property value

Returns
Type Description
System.Guid

The id of the created page

ImportContent(String, String, IDictionary<String, String>, String, Guid, Guid, String)

Creates or Updates a content item in EPiServer

Declaration
public abstract Guid ImportContent(string channelId, string contentName, IDictionary<string, string> propertyMap, string cultureName, Guid contentId, Guid parentId, string contentTypeName)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.String contentName

Name of the content.

System.Collections.Generic.IDictionary<System.String, System.String> propertyMap

The property map consisting of property name/property value

System.String cultureName

Name of the culture for the page

System.Guid contentId

The content id.

System.Guid parentId

The parent id.

System.String contentTypeName

Name of the content type.

Returns
Type Description
System.Guid

The id of the created item

ImportFile(String, Byte[], Boolean, Guid, String, IDictionary<String, String>)

Imports a file to EPiServer according to a specified ContentChannel.

Declaration
public abstract string ImportFile(string channelId, byte[] data, bool expectMoreData, Guid fileId, string channelRelativeFilePath, IDictionary<string, string> summary)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.Byte[] data

The data to write to file

System.Boolean expectMoreData

if set to true data is chunked and more data is expected.

System.Guid fileId

The identity for the file

System.String channelRelativeFilePath

The file path relative to the root given on the ContentChannel. File name should be included in path

System.Collections.Generic.IDictionary<System.String, System.String> summary

Meta data for the file

Returns
Type Description
System.String

The virtual path to the created file

ImportFile(String, Byte[], Boolean, Guid, String, IDictionary<String, String>, Guid)

Imports the file to a page folder according to a specified ContentChannel.

Declaration
public abstract string ImportFile(string channelId, byte[] data, bool expectMoreData, Guid fileId, string fileName, IDictionary<string, string> summary, Guid pageId)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.Byte[] data

The data to write to file

System.Boolean expectMoreData

if set to true data is chunked and more data is expected.

System.Guid fileId

The identity for the file

System.String fileName

Name of the file.

System.Collections.Generic.IDictionary<System.String, System.String> summary

Meta data for the file.

System.Guid pageId

The id for the page whose page folder the file will be created in

Returns
Type Description
System.String

The virtual path to the created file

ImportFile(String, Byte[], Boolean, String)

Imports a file to EPiServer according to a specified ContentChannel.

Declaration
public abstract string ImportFile(string channelId, byte[] data, bool expectMoreData, string channelRelativeFilePath)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.Byte[] data

The data to write to file

System.Boolean expectMoreData

if set to true if more data is expected

System.String channelRelativeFilePath

The file path relative to the root given on the ContentChannel. File name should be included in path

Returns
Type Description
System.String

The virtual path to the created file

ImportFileMetaData(String, String, IDictionary<String, String>)

Imports metadata for a file to EPiServer according to a specified ContentChannel.

Declaration
public abstract string ImportFileMetaData(string channelId, string virtualFilePath, IDictionary<string, string> summary)
Parameters
Type Name Description
System.String channelId

The id of the ContentChannel that should be used at import

System.String virtualFilePath

The virtual file path. If the path not starts with '~/' it will be appended to channel root path

System.Collections.Generic.IDictionary<System.String, System.String> summary

Meta data for the file

Returns
Type Description
System.String

The virtual path for the file

Events

ContentDeleted

Event raised when a page was deleted

Declaration
public static event EventHandler<ContentDeletedEventArgs> ContentDeleted
Event Type
Type Description
System.EventHandler<ContentDeletedEventArgs>

ContentDeleting

Event raised when a content (or language version of a content) is to be deleted

Declaration
public static event EventHandler<ContentDeletingEventArgs> ContentDeleting
Event Type
Type Description
System.EventHandler<ContentDeletingEventArgs>

ContentFileImporting

Event raised when a file is to be imported to a page folder

Declaration
public static event EventHandler<ContentFileImportingEventArgs> ContentFileImporting
Event Type
Type Description
System.EventHandler<ContentFileImportingEventArgs>

ContentFileMetaDataImporting

Event raised when a metadata is written to a content based file

Declaration
public static event EventHandler<ContentFileMetaDataImportingEventArgs> ContentFileMetaDataImporting
Event Type
Type Description
System.EventHandler<ContentFileMetaDataImportingEventArgs>

ContentImported

Event raised when a content has been imported

Declaration
public static event EventHandler<ContentImportedEventArgs> ContentImported
Event Type
Type Description
System.EventHandler<ContentImportedEventArgs>

ContentImporting

Event raised when a content is to be imported

Declaration
public static event EventHandler<ContentImportingEventArgs> ContentImporting
Event Type
Type Description
System.EventHandler<ContentImportingEventArgs>

DirectoryDeleted

Event raised when a directory was deleted

Declaration
public static event EventHandler<DirectoryEventArgs> DirectoryDeleted
Event Type
Type Description
System.EventHandler<DirectoryEventArgs>

DirectoryDeleting

Event raised when a directory is to be deleted

Declaration
public static event EventHandler<DirectoryDeletingEventArgs> DirectoryDeleting
Event Type
Type Description
System.EventHandler<DirectoryDeletingEventArgs>

FileDeleted

Event raised when a file was deleted

Declaration
public static event EventHandler<FileEventArgs> FileDeleted
Event Type
Type Description
System.EventHandler<FileEventArgs>

FileDeleting

Event raised when a file is to be deleted

Declaration
public static event EventHandler<FileDeletingEventArgs> FileDeleting
Event Type
Type Description
System.EventHandler<FileDeletingEventArgs>

FileImported

Event raised when a file has been imported

Declaration
public static event EventHandler<FileEventArgs> FileImported
Event Type
Type Description
System.EventHandler<FileEventArgs>

FileImporting

Event raised when a file is to be imported

Declaration
public static event EventHandler<FileImportingEventArgs> FileImporting
Event Type
Type Description
System.EventHandler<FileImportingEventArgs>

FileMetaDataImporting

Event raised when a metadata is written to a unified file

Declaration
public static event EventHandler<FileMetaDataImportingEventArgs> FileMetaDataImporting
Event Type
Type Description
System.EventHandler<FileMetaDataImportingEventArgs>

PageDeleted

Event raised when a page was deleted

Declaration
[Obsolete("Use ContentDeleted instead", false)]
public static event EventHandler<PageDeletedEventArgs> PageDeleted
Event Type
Type Description
System.EventHandler<PageDeletedEventArgs>

PageDeleting

Event raised when a page (or language version of a page) is to be deleted

Declaration
[Obsolete("Use ContentDeleting instead", false)]
public static event EventHandler<PageDeletingEventArgs> PageDeleting
Event Type
Type Description
System.EventHandler<PageDeletingEventArgs>

PageFileImporting

Event raised when a file is to be imported to a page folder

Declaration
[Obsolete("Use ContentFileImporting instead", false)]
public static event EventHandler<PageFileImportingEventArgs> PageFileImporting
Event Type
Type Description
System.EventHandler<PageFileImportingEventArgs>

PageImported

Event raised when a page has been imported

Declaration
[Obsolete("Use ContentImported instead", false)]
public static event EventHandler<PageImportedEventArgs> PageImported
Event Type
Type Description
System.EventHandler<PageImportedEventArgs>

PageImporting

Event raised when a page is to be imported

Declaration
[Obsolete("Use ContentImporting instead", false)]
public static event EventHandler<PageImportingEventArgs> PageImporting
Event Type
Type Description
System.EventHandler<PageImportingEventArgs>

PropertyImporting

Event raised when a property value is to be imported to an IContent instance.

Declaration
public static event EventHandler<PropertyImportingEventArgs> PropertyImporting
Event Type
Type Description
System.EventHandler<PropertyImportingEventArgs>

Implements

Extension Methods